summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2026-03-16 23:09:37 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-05-22 13:32:05 +0200
commit9ecab063e9821b23c82907d7889302c22f197e1e (patch)
tree41529df44f1287c6bdab60cafe4641cecde1ecb3 /drivers/base
parentb382754793b1af27899164a5b412ff2f49eb24d5 (diff)
downloadlinux-next-9ecab063e9821b23c82907d7889302c22f197e1e.tar.gz
linux-next-9ecab063e9821b23c82907d7889302c22f197e1e.zip
driver core: constify group arrays arguments in driver_add_groups and driver_remove_groups
Constify the groups array argument in driver_add_groups and driver_remove_groups. This allows to pass constant arrays as arguments. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://patch.msgid.link/21a1e5f1-c6a0-4f6f-aa86-1e6abd25f9c6@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/base.h6
-rw-r--r--drivers/base/driver.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 483b99b4fa3d..a5b7abc10ff0 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -194,8 +194,10 @@ static inline void dev_sync_state(struct device *dev)
dev->driver->sync_state(dev);
}
-int driver_add_groups(const struct device_driver *drv, const struct attribute_group **groups);
-void driver_remove_groups(const struct device_driver *drv, const struct attribute_group **groups);
+int driver_add_groups(const struct device_driver *drv,
+ const struct attribute_group *const *groups);
+void driver_remove_groups(const struct device_driver *drv,
+ const struct attribute_group *const *groups);
void device_driver_detach(struct device *dev);
static inline void device_set_driver(struct device *dev, const struct device_driver *drv)
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 8ab010ddf709..c5ebf1fdad75 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -203,13 +203,13 @@ void driver_remove_file(const struct device_driver *drv,
EXPORT_SYMBOL_GPL(driver_remove_file);
int driver_add_groups(const struct device_driver *drv,
- const struct attribute_group **groups)
+ const struct attribute_group *const *groups)
{
return sysfs_create_groups(&drv->p->kobj, groups);
}
void driver_remove_groups(const struct device_driver *drv,
- const struct attribute_group **groups)
+ const struct attribute_group *const *groups)
{
sysfs_remove_groups(&drv->p->kobj, groups);
}