[PATCH 4/6] driver core: make device_release_driver_internal() take a const *

From: Greg Kroah-Hartman
Date: Tue Jun 11 2024 - 09:01:59 EST


Change device_release_driver_internal() to take a const struct
device_driver * as it is not modifying it at all.

Cc: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/base/base.h | 2 +-
drivers/base/dd.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/base.h b/drivers/base/base.h
index cba8307908c7..d332b87cde9e 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -155,7 +155,7 @@ bool bus_is_registered(const struct bus_type *bus);

int bus_add_driver(struct device_driver *drv);
void bus_remove_driver(struct device_driver *drv);
-void device_release_driver_internal(struct device *dev, struct device_driver *drv,
+void device_release_driver_internal(struct device *dev, const struct device_driver *drv,
struct device *parent);

void driver_detach(struct device_driver *drv);
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 83d352394fdf..c24eca917d41 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -1284,7 +1284,7 @@ static void __device_release_driver(struct device *dev, struct device *parent)
}

void device_release_driver_internal(struct device *dev,
- struct device_driver *drv,
+ const struct device_driver *drv,
struct device *parent)
{
__device_driver_lock(dev, parent);
--
2.45.2