Skip to content

Commit 0725e8f

Browse files
committed
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 841b7eb commit 0725e8f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/base/base.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ static inline void dev_sync_state(struct device *dev)
175175
dev->driver->sync_state(dev);
176176
}
177177

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);
180180
void device_driver_detach(struct device *dev);
181181

182182
int devres_release_all(struct device *dev);

drivers/base/driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ void driver_remove_file(struct device_driver *drv,
199199
}
200200
EXPORT_SYMBOL_GPL(driver_remove_file);
201201

202-
int driver_add_groups(struct device_driver *drv,
202+
int driver_add_groups(const struct device_driver *drv,
203203
const struct attribute_group **groups)
204204
{
205205
return sysfs_create_groups(&drv->p->kobj, groups);
206206
}
207207

208-
void driver_remove_groups(struct device_driver *drv,
208+
void driver_remove_groups(const struct device_driver *drv,
209209
const struct attribute_group **groups)
210210
{
211211
sysfs_remove_groups(&drv->p->kobj, groups);

0 commit comments

Comments
 (0)