diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-08 11:15:45 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-10 10:36:02 +0300 |
commit | ab7a880263c30b1675850a584c206770f5545c2f (patch) | |
tree | dfde1a68789354fb648e6de1fc19c49804e27dfb /drivers/base | |
parent | a23b018c3bf646274f02edd46bf448c20c826d94 (diff) | |
download | linux-ab7a880263c30b1675850a584c206770f5545c2f.tar.xz |
driver core: make driver_[create|remove]_file take a const *
The functions driver_create_file() and driver_remove_file() do not
modify the struct device_driver structure directly, so they are safe to
be marked as a constant pointer type.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Link: https://lore.kernel.org/r/2024070844-volley-hatchling-c812@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/driver.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 85b4c00df078..3eeafdb79d0e 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -173,7 +173,7 @@ EXPORT_SYMBOL_GPL(driver_find_device); * @drv: driver. * @attr: driver attribute descriptor. */ -int driver_create_file(struct device_driver *drv, +int driver_create_file(const struct device_driver *drv, const struct driver_attribute *attr) { int error; @@ -191,7 +191,7 @@ EXPORT_SYMBOL_GPL(driver_create_file); * @drv: driver. * @attr: driver attribute descriptor. */ -void driver_remove_file(struct device_driver *drv, +void driver_remove_file(const struct device_driver *drv, const struct driver_attribute *attr) { if (drv) |