diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-08 10:15:45 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-10 09:36:02 +0200 |
commit | ab7a880263c30b1675850a584c206770f5545c2f (patch) | |
tree | dfde1a68789354fb648e6de1fc19c49804e27dfb /include/linux/device | |
parent | a23b018c3bf646274f02edd46bf448c20c826d94 (diff) |
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 'include/linux/device')
-rw-r--r-- | include/linux/device/driver.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h index 7738f458995f..dceb36f1c42c 100644 --- a/include/linux/device/driver.h +++ b/include/linux/device/driver.h @@ -146,9 +146,9 @@ struct driver_attribute { #define DRIVER_ATTR_WO(_name) \ struct driver_attribute driver_attr_##_name = __ATTR_WO(_name) -int __must_check driver_create_file(struct device_driver *driver, +int __must_check driver_create_file(const struct device_driver *driver, const struct driver_attribute *attr); -void driver_remove_file(struct device_driver *driver, +void driver_remove_file(const struct device_driver *driver, const struct driver_attribute *attr); int driver_set_override(struct device *dev, const char **override, |