aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 1a3686d15f98..45e5b1921fbb 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -65,7 +65,7 @@ struct bus_type {
65 int (*resume_early)(struct device *dev); 65 int (*resume_early)(struct device *dev);
66 int (*resume)(struct device *dev); 66 int (*resume)(struct device *dev);
67 67
68 struct pm_ext_ops *pm; 68 struct dev_pm_ops *pm;
69 69
70 struct bus_type_private *p; 70 struct bus_type_private *p;
71}; 71};
@@ -133,7 +133,7 @@ struct device_driver {
133 int (*resume) (struct device *dev); 133 int (*resume) (struct device *dev);
134 struct attribute_group **groups; 134 struct attribute_group **groups;
135 135
136 struct pm_ops *pm; 136 struct dev_pm_ops *pm;
137 137
138 struct driver_private *p; 138 struct driver_private *p;
139}; 139};
@@ -198,7 +198,7 @@ struct class {
198 int (*suspend)(struct device *dev, pm_message_t state); 198 int (*suspend)(struct device *dev, pm_message_t state);
199 int (*resume)(struct device *dev); 199 int (*resume)(struct device *dev);
200 200
201 struct pm_ops *pm; 201 struct dev_pm_ops *pm;
202 struct class_private *p; 202 struct class_private *p;
203}; 203};
204 204
@@ -291,7 +291,7 @@ struct device_type {
291 int (*suspend)(struct device *dev, pm_message_t state); 291 int (*suspend)(struct device *dev, pm_message_t state);
292 int (*resume)(struct device *dev); 292 int (*resume)(struct device *dev);
293 293
294 struct pm_ops *pm; 294 struct dev_pm_ops *pm;
295}; 295};
296 296
297/* interface for exporting device attributes */ 297/* interface for exporting device attributes */
@@ -373,9 +373,9 @@ struct device {
373 373
374 struct kobject kobj; 374 struct kobject kobj;
375 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 375 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
376 unsigned uevent_suppress:1;
376 const char *init_name; /* initial name of the device */ 377 const char *init_name; /* initial name of the device */
377 struct device_type *type; 378 struct device_type *type;
378 unsigned uevent_suppress:1;
379 379
380 struct semaphore sem; /* semaphore to synchronize calls to 380 struct semaphore sem; /* semaphore to synchronize calls to
381 * its driver. 381 * its driver.
@@ -408,12 +408,13 @@ struct device {
408 /* arch specific additions */ 408 /* arch specific additions */
409 struct dev_archdata archdata; 409 struct dev_archdata archdata;
410 410
411 dev_t devt; /* dev_t, creates the sysfs "dev" */
412
411 spinlock_t devres_lock; 413 spinlock_t devres_lock;
412 struct list_head devres_head; 414 struct list_head devres_head;
413 415
414 struct klist_node knode_class; 416 struct klist_node knode_class;
415 struct class *class; 417 struct class *class;
416 dev_t devt; /* dev_t, creates the sysfs "dev" */
417 struct attribute_group **groups; /* optional groups */ 418 struct attribute_group **groups; /* optional groups */
418 419
419 void (*release)(struct device *dev); 420 void (*release)(struct device *dev);
@@ -483,6 +484,17 @@ extern int device_rename(struct device *dev, char *new_name);
483extern int device_move(struct device *dev, struct device *new_parent); 484extern int device_move(struct device *dev, struct device *new_parent);
484 485
485/* 486/*
487 * Root device objects for grouping under /sys/devices
488 */
489extern struct device *__root_device_register(const char *name,
490 struct module *owner);
491static inline struct device *root_device_register(const char *name)
492{
493 return __root_device_register(name, THIS_MODULE);
494}
495extern void root_device_unregister(struct device *root);
496
497/*
486 * Manual binding of a device to driver. See drivers/base/bus.c 498 * Manual binding of a device to driver. See drivers/base/bus.c
487 * for information on use. 499 * for information on use.
488 */ 500 */
@@ -553,13 +565,13 @@ extern const char *dev_driver_string(const struct device *dev);
553#define dev_info(dev, format, arg...) \ 565#define dev_info(dev, format, arg...) \
554 dev_printk(KERN_INFO , dev , format , ## arg) 566 dev_printk(KERN_INFO , dev , format , ## arg)
555 567
556#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) 568#if defined(DEBUG)
569#define dev_dbg(dev, format, arg...) \
570 dev_printk(KERN_DEBUG , dev , format , ## arg)
571#elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
557#define dev_dbg(dev, format, ...) do { \ 572#define dev_dbg(dev, format, ...) do { \
558 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ 573 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
559 } while (0) 574 } while (0)
560#elif defined(DEBUG)
561#define dev_dbg(dev, format, arg...) \
562 dev_printk(KERN_DEBUG , dev , format , ## arg)
563#else 575#else
564#define dev_dbg(dev, format, arg...) \ 576#define dev_dbg(dev, format, arg...) \
565 ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) 577 ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })