mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 09:02:21 -04:00
driver: core: constify groups array argument in device_add_groups and device_remove_groups
Now that sysfs_create_groups() and sysfs_remove_groups() allow to pass constant groups arrays, we can constify the groups array argument also here. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://patch.msgid.link/8ea2d6d1-0adb-4d7f-92bc-751e93ce08d6@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
fe2511adb1
commit
ece5283706
@@ -2831,14 +2831,15 @@ static ssize_t removable_show(struct device *dev, struct device_attribute *attr,
|
||||
}
|
||||
static DEVICE_ATTR_RO(removable);
|
||||
|
||||
int device_add_groups(struct device *dev, const struct attribute_group **groups)
|
||||
int device_add_groups(struct device *dev,
|
||||
const struct attribute_group *const *groups)
|
||||
{
|
||||
return sysfs_create_groups(&dev->kobj, groups);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(device_add_groups);
|
||||
|
||||
void device_remove_groups(struct device *dev,
|
||||
const struct attribute_group **groups)
|
||||
const struct attribute_group *const *groups)
|
||||
{
|
||||
sysfs_remove_groups(&dev->kobj, groups);
|
||||
}
|
||||
|
||||
@@ -1131,9 +1131,9 @@ device_create_with_groups(const struct class *cls, struct device *parent, dev_t
|
||||
void device_destroy(const struct class *cls, dev_t devt);
|
||||
|
||||
int __must_check device_add_groups(struct device *dev,
|
||||
const struct attribute_group **groups);
|
||||
const struct attribute_group *const *groups);
|
||||
void device_remove_groups(struct device *dev,
|
||||
const struct attribute_group **groups);
|
||||
const struct attribute_group *const *groups);
|
||||
|
||||
static inline int __must_check device_add_group(struct device *dev,
|
||||
const struct attribute_group *grp)
|
||||
|
||||
Reference in New Issue
Block a user