Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

driver core: driver: mark driver_add/remove_groups constant

driver_add_groups() and driver_remove_groups should take a constant
pointer as the structure is not modified, so make the change.

Cc: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20240611130103.3262749-9-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+4 -4
+2 -2
drivers/base/base.h
··· 175 175 dev->driver->sync_state(dev); 176 176 } 177 177 178 - int driver_add_groups(struct device_driver *drv, const struct attribute_group **groups); 179 - void driver_remove_groups(struct device_driver *drv, const struct attribute_group **groups); 178 + int driver_add_groups(const struct device_driver *drv, const struct attribute_group **groups); 179 + void driver_remove_groups(const struct device_driver *drv, const struct attribute_group **groups); 180 180 void device_driver_detach(struct device *dev); 181 181 182 182 int devres_release_all(struct device *dev);
+2 -2
drivers/base/driver.c
··· 199 199 } 200 200 EXPORT_SYMBOL_GPL(driver_remove_file); 201 201 202 - int driver_add_groups(struct device_driver *drv, 202 + int driver_add_groups(const struct device_driver *drv, 203 203 const struct attribute_group **groups) 204 204 { 205 205 return sysfs_create_groups(&drv->p->kobj, groups); 206 206 } 207 207 208 - void driver_remove_groups(struct device_driver *drv, 208 + void driver_remove_groups(const struct device_driver *drv, 209 209 const struct attribute_group **groups) 210 210 { 211 211 sysfs_remove_groups(&drv->p->kobj, groups);