aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-22 12:00:15 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-22 12:00:15 +0200
commit1af824f085e813e06548212b18bbc788b16f60e6 (patch)
tree7e4bea76e0780330e27d660633ba514dc02e2fbf /include/linux
parentarch_topology: Get rid of cap_parsing_done (diff)
parentInput: axp20x-pek - switch to using devm_device_add_group() (diff)
downloadlinux-dev-1af824f085e813e06548212b18bbc788b16f60e6.tar.xz
linux-dev-1af824f085e813e06548212b18bbc788b16f60e6.zip
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')
-rw-r--r--include/linux/device.h30
-rw-r--r--include/linux/kobject.h2
2 files changed, 32 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
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index eeab34b0f589..9e05c8b2c287 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -57,6 +57,8 @@ enum kobject_action {
KOBJ_MOVE,
KOBJ_ONLINE,
KOBJ_OFFLINE,
+ KOBJ_BIND,
+ KOBJ_UNBIND,
KOBJ_MAX
};