Skip to content

Commit f6e98ef

Browse files
committed
driver core: make driver_detach() take a const *
driver_detach() does not modify the driver itself, so make the pointer constant. In doing so, the function driver_allows_async_probing() also needs to be changed so that the pointer type passes through to that function properly. Cc: Rafael J. Wysocki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 33ebea9 commit f6e98ef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/base/base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void bus_remove_driver(struct device_driver *drv);
158158
void device_release_driver_internal(struct device *dev, const struct device_driver *drv,
159159
struct device *parent);
160160

161-
void driver_detach(struct device_driver *drv);
161+
void driver_detach(const struct device_driver *drv);
162162
void driver_deferred_probe_del(struct device *dev);
163163
void device_set_deferred_probe_reason(const struct device *dev, struct va_format *vaf);
164164
static inline int driver_match_device(struct device_driver *drv,

drivers/base/dd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ static int __init save_async_options(char *buf)
863863
}
864864
__setup("driver_async_probe=", save_async_options);
865865

866-
static bool driver_allows_async_probing(struct device_driver *drv)
866+
static bool driver_allows_async_probing(const struct device_driver *drv)
867867
{
868868
switch (drv->probe_type) {
869869
case PROBE_PREFER_ASYNCHRONOUS:
@@ -1333,7 +1333,7 @@ void device_driver_detach(struct device *dev)
13331333
* driver_detach - detach driver from all devices it controls.
13341334
* @drv: driver.
13351335
*/
1336-
void driver_detach(struct device_driver *drv)
1336+
void driver_detach(const struct device_driver *drv)
13371337
{
13381338
struct device_private *dev_prv;
13391339
struct device *dev;

0 commit comments

Comments
 (0)