diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-22 12:00:15 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-22 12:00:15 +0200 |
commit | 1af824f085e813e06548212b18bbc788b16f60e6 (patch) | |
tree | 7e4bea76e0780330e27d660633ba514dc02e2fbf /include/linux/device.h | |
parent | d8bcf4db9244e2b85597c680f4e1c3a837b067fe (diff) | |
parent | 072a7852338af900c302490474939e089f4bd4c4 (diff) |
Merge branch 'bind_unbind' into driver-core-next
This merges the bind_unbind driver core feature into the
driver-core-next branch. bind_unbind is a branch so that others can
pull and work off of it safely.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r-- | include/linux/device.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 723cd54b94da..c29dd5ec7f6a 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1200,6 +1200,36 @@ struct device *device_create_with_groups(struct class *cls, const char *fmt, ...); extern void device_destroy(struct class *cls, dev_t devt); +extern int __must_check device_add_groups(struct device *dev, + const struct attribute_group **groups); +extern void device_remove_groups(struct device *dev, + const struct attribute_group **groups); + +static inline int __must_check device_add_group(struct device *dev, + const struct attribute_group *grp) +{ + const struct attribute_group *groups[] = { grp, NULL }; + + return device_add_groups(dev, groups); +} + +static inline void device_remove_group(struct device *dev, + const struct attribute_group *grp) +{ + const struct attribute_group *groups[] = { grp, NULL }; + + return device_remove_groups(dev, groups); +} + +extern int __must_check devm_device_add_groups(struct device *dev, + const struct attribute_group **groups); +extern void devm_device_remove_groups(struct device *dev, + const struct attribute_group **groups); +extern int __must_check devm_device_add_group(struct device *dev, + const struct attribute_group *grp); +extern void devm_device_remove_group(struct device *dev, + const struct attribute_group *grp); + /* * Platform "fixup" functions - allow the platform to have their say * about devices and actions that the general device layer doesn't |