summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-07-14 16:05:57 -0700
committerZefan Li <lizefan@huawei.com>2015-04-14 17:33:53 +0800
commit4ef74f7a57f95fa31db9d415c5dee165e7c4875c (patch)
tree5dbfd93b032ce6b3127f002eb293275468e1dc09 /include
parentaa12b754cfbd5b5c900d43a6a215b096d8afc0ee (diff)
driver core: Introduce device_create_groups
commit 39ef311204941ddd01ea2950d6220c8ccc710d15 upstream. device_create_groups lets callers create devices as well as associated sysfs attributes with a single call. This avoids race conditions seen if sysfs attributes on new devices are created later. [fixed up comment block placement and add checks for printk buffer formats - gregkh] Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [lizf: Backported to 3.4: adjust context] Signed-off-by: Zefan Li <lizefan@huawei.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 5ad17cccdd71..e93fed98878a 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -835,6 +835,11 @@ extern __printf(5, 6)
struct device *device_create(struct class *cls, struct device *parent,
dev_t devt, void *drvdata,
const char *fmt, ...);
+extern __printf(6, 7)
+struct device *device_create_with_groups(struct class *cls,
+ struct device *parent, dev_t devt, void *drvdata,
+ const struct attribute_group **groups,
+ const char *fmt, ...);
extern void device_destroy(struct class *cls, dev_t devt);
/*