aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-05-15 16:44:08 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-05-20 16:31:53 -0400
commit8882b39421bae317e3ee864edd845e994307ce16 (patch)
treecef24e2a04ad6716d37af2fabfe5f0a72dfe44b7 /include
parentc110a2bd82676a8f124cf4dfc39339fd366f0e59 (diff)
Driver core: add device_create_vargs and device_create_drvdata
We want to have the drvdata field set properly when creating the device as sysfs callbacks can assume it is present and it can race the later setting of this field. So, create two new functions, deviec_create_vargs() and device_create_drvdata() that take this new field. device_create_drvdata() will go away in 2.6.27 as the drvdata field will just be moved to the device_create() call as it should be. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 15e9fa3ad3af..14616e80213c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -449,9 +449,21 @@ extern int __must_check device_reprobe(struct device *dev);
449/* 449/*
450 * Easy functions for dynamically creating devices on the fly 450 * Easy functions for dynamically creating devices on the fly
451 */ 451 */
452extern struct device *device_create_vargs(struct class *cls,
453 struct device *parent,
454 dev_t devt,
455 void *drvdata,
456 const char *fmt,
457 va_list vargs);
452extern struct device *device_create(struct class *cls, struct device *parent, 458extern struct device *device_create(struct class *cls, struct device *parent,
453 dev_t devt, const char *fmt, ...) 459 dev_t devt, const char *fmt, ...)
454 __attribute__((format(printf, 4, 5))); 460 __attribute__((format(printf, 4, 5)));
461extern struct device *device_create_drvdata(struct class *cls,
462 struct device *parent,
463 dev_t devt,
464 void *drvdata,
465 const char *fmt, ...)
466 __attribute__((format(printf, 5, 6)));
455extern void device_destroy(struct class *cls, dev_t devt); 467extern void device_destroy(struct class *cls, dev_t devt);
456 468
457/* 469/*