summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-08 11:15:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-10 10:36:02 +0300
commitab7a880263c30b1675850a584c206770f5545c2f (patch)
treedfde1a68789354fb648e6de1fc19c49804e27dfb /drivers/base
parenta23b018c3bf646274f02edd46bf448c20c826d94 (diff)
downloadlinux-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.c4
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)