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.h34
1 files changed, 24 insertions, 10 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 1a3686d15f98..47f343c7bdda 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};
@@ -147,6 +147,8 @@ extern void put_driver(struct device_driver *drv);
147extern struct device_driver *driver_find(const char *name, 147extern struct device_driver *driver_find(const char *name,
148 struct bus_type *bus); 148 struct bus_type *bus);
149extern int driver_probe_done(void); 149extern int driver_probe_done(void);
150extern int wait_for_device_probe(void);
151
150 152
151/* sysfs interface for exporting driver attributes */ 153/* sysfs interface for exporting driver attributes */
152 154
@@ -198,7 +200,7 @@ struct class {
198 int (*suspend)(struct device *dev, pm_message_t state); 200 int (*suspend)(struct device *dev, pm_message_t state);
199 int (*resume)(struct device *dev); 201 int (*resume)(struct device *dev);
200 202
201 struct pm_ops *pm; 203 struct dev_pm_ops *pm;
202 struct class_private *p; 204 struct class_private *p;
203}; 205};
204 206
@@ -291,7 +293,7 @@ struct device_type {
291 int (*suspend)(struct device *dev, pm_message_t state); 293 int (*suspend)(struct device *dev, pm_message_t state);
292 int (*resume)(struct device *dev); 294 int (*resume)(struct device *dev);
293 295
294 struct pm_ops *pm; 296 struct dev_pm_ops *pm;
295}; 297};
296 298
297/* interface for exporting device attributes */ 299/* interface for exporting device attributes */
@@ -373,9 +375,9 @@ struct device {
373 375
374 struct kobject kobj; 376 struct kobject kobj;
375 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 377 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
378 unsigned uevent_suppress:1;
376 const char *init_name; /* initial name of the device */ 379 const char *init_name; /* initial name of the device */
377 struct device_type *type; 380 struct device_type *type;
378 unsigned uevent_suppress:1;
379 381
380 struct semaphore sem; /* semaphore to synchronize calls to 382 struct semaphore sem; /* semaphore to synchronize calls to
381 * its driver. 383 * its driver.
@@ -408,12 +410,13 @@ struct device {
408 /* arch specific additions */ 410 /* arch specific additions */
409 struct dev_archdata archdata; 411 struct dev_archdata archdata;
410 412
413 dev_t devt; /* dev_t, creates the sysfs "dev" */
414
411 spinlock_t devres_lock; 415 spinlock_t devres_lock;
412 struct list_head devres_head; 416 struct list_head devres_head;
413 417
414 struct klist_node knode_class; 418 struct klist_node knode_class;
415 struct class *class; 419 struct class *class;
416 dev_t devt; /* dev_t, creates the sysfs "dev" */
417 struct attribute_group **groups; /* optional groups */ 420 struct attribute_group **groups; /* optional groups */
418 421
419 void (*release)(struct device *dev); 422 void (*release)(struct device *dev);
@@ -483,6 +486,17 @@ extern int device_rename(struct device *dev, char *new_name);
483extern int device_move(struct device *dev, struct device *new_parent); 486extern int device_move(struct device *dev, struct device *new_parent);
484 487
485/* 488/*
489 * Root device objects for grouping under /sys/devices
490 */
491extern struct device *__root_device_register(const char *name,
492 struct module *owner);
493static inline struct device *root_device_register(const char *name)
494{
495 return __root_device_register(name, THIS_MODULE);
496}
497extern void root_device_unregister(struct device *root);
498
499/*
486 * Manual binding of a device to driver. See drivers/base/bus.c 500 * Manual binding of a device to driver. See drivers/base/bus.c
487 * for information on use. 501 * for information on use.
488 */ 502 */
@@ -553,13 +567,13 @@ extern const char *dev_driver_string(const struct device *dev);
553#define dev_info(dev, format, arg...) \ 567#define dev_info(dev, format, arg...) \
554 dev_printk(KERN_INFO , dev , format , ## arg) 568 dev_printk(KERN_INFO , dev , format , ## arg)
555 569
556#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) 570#if defined(DEBUG)
571#define dev_dbg(dev, format, arg...) \
572 dev_printk(KERN_DEBUG , dev , format , ## arg)
573#elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
557#define dev_dbg(dev, format, ...) do { \ 574#define dev_dbg(dev, format, ...) do { \
558 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ 575 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
559 } while (0) 576 } while (0)
560#elif defined(DEBUG)
561#define dev_dbg(dev, format, arg...) \
562 dev_printk(KERN_DEBUG , dev , format , ## arg)
563#else 577#else
564#define dev_dbg(dev, format, arg...) \ 578#define dev_dbg(dev, format, arg...) \
565 ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) 579 ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })