diff options
author | Guenter Roeck <linux@roeck-us.net> | 2013-07-14 16:05:57 -0700 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2015-02-20 00:49:37 +0000 |
commit | df56561b21ede181eb2a4888dbba060e648feccd (patch) | |
tree | a9f43fb54acbfb46f9965456686744fce80e73f1 /include/linux | |
parent | d4cf625cc1965ccf4433bce0bfb62c9d5c2ef436 (diff) | |
download | lwn-df56561b21ede181eb2a4888dbba060e648feccd.tar.gz lwn-df56561b21ede181eb2a4888dbba060e648feccd.zip |
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>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/device.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 3136ede5a1e1..a31c5d0b89a4 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -767,6 +767,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); /* |