diff options
Diffstat (limited to 'include/linux/device.h')
| -rw-r--r-- | include/linux/device.h | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index c79b93e56fa0..1a060265acea 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -429,7 +429,6 @@ struct device { | |||
| 429 | struct kobject kobj; | 429 | struct kobject kobj; |
| 430 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 430 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
| 431 | struct device_type *type; | 431 | struct device_type *type; |
| 432 | unsigned is_registered:1; | ||
| 433 | unsigned uevent_suppress:1; | 432 | unsigned uevent_suppress:1; |
| 434 | 433 | ||
| 435 | struct semaphore sem; /* semaphore to synchronize calls to | 434 | struct semaphore sem; /* semaphore to synchronize calls to |
| @@ -475,6 +474,9 @@ struct device { | |||
| 475 | void (*release)(struct device *dev); | 474 | void (*release)(struct device *dev); |
| 476 | }; | 475 | }; |
| 477 | 476 | ||
| 477 | /* Get the wakeup routines, which depend on struct device */ | ||
| 478 | #include <linux/pm_wakeup.h> | ||
| 479 | |||
| 478 | #ifdef CONFIG_NUMA | 480 | #ifdef CONFIG_NUMA |
| 479 | static inline int dev_to_node(struct device *dev) | 481 | static inline int dev_to_node(struct device *dev) |
| 480 | { | 482 | { |
| @@ -506,7 +508,7 @@ static inline void dev_set_drvdata(struct device *dev, void *data) | |||
| 506 | 508 | ||
| 507 | static inline int device_is_registered(struct device *dev) | 509 | static inline int device_is_registered(struct device *dev) |
| 508 | { | 510 | { |
| 509 | return dev->is_registered; | 511 | return dev->kobj.state_in_sysfs; |
| 510 | } | 512 | } |
| 511 | 513 | ||
| 512 | void driver_init(void); | 514 | void driver_init(void); |
| @@ -543,20 +545,6 @@ extern struct device *device_create(struct class *cls, struct device *parent, | |||
| 543 | dev_t devt, const char *fmt, ...) | 545 | dev_t devt, const char *fmt, ...) |
| 544 | __attribute__((format(printf, 4, 5))); | 546 | __attribute__((format(printf, 4, 5))); |
| 545 | extern void device_destroy(struct class *cls, dev_t devt); | 547 | extern void device_destroy(struct class *cls, dev_t devt); |
| 546 | #ifdef CONFIG_PM_SLEEP | ||
| 547 | extern void destroy_suspended_device(struct class *cls, dev_t devt); | ||
| 548 | extern void device_pm_schedule_removal(struct device *); | ||
| 549 | #else /* !CONFIG_PM_SLEEP */ | ||
| 550 | static inline void destroy_suspended_device(struct class *cls, dev_t devt) | ||
| 551 | { | ||
| 552 | device_destroy(cls, devt); | ||
| 553 | } | ||
| 554 | |||
| 555 | static inline void device_pm_schedule_removal(struct device *dev) | ||
| 556 | { | ||
| 557 | device_unregister(dev); | ||
| 558 | } | ||
| 559 | #endif /* !CONFIG_PM_SLEEP */ | ||
| 560 | 548 | ||
| 561 | /* | 549 | /* |
| 562 | * Platform "fixup" functions - allow the platform to have their say | 550 | * Platform "fixup" functions - allow the platform to have their say |
| @@ -608,21 +596,16 @@ extern const char *dev_driver_string(struct device *dev); | |||
| 608 | #define dev_dbg(dev, format, arg...) \ | 596 | #define dev_dbg(dev, format, arg...) \ |
| 609 | dev_printk(KERN_DEBUG , dev , format , ## arg) | 597 | dev_printk(KERN_DEBUG , dev , format , ## arg) |
| 610 | #else | 598 | #else |
| 611 | static inline int __attribute__ ((format (printf, 2, 3))) | 599 | #define dev_dbg(dev, format, arg...) \ |
| 612 | dev_dbg(struct device *dev, const char *fmt, ...) | 600 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) |
| 613 | { | ||
| 614 | return 0; | ||
| 615 | } | ||
| 616 | #endif | 601 | #endif |
| 617 | 602 | ||
| 618 | #ifdef VERBOSE_DEBUG | 603 | #ifdef VERBOSE_DEBUG |
| 619 | #define dev_vdbg dev_dbg | 604 | #define dev_vdbg dev_dbg |
| 620 | #else | 605 | #else |
| 621 | static inline int __attribute__ ((format (printf, 2, 3))) | 606 | |
| 622 | dev_vdbg(struct device *dev, const char *fmt, ...) | 607 | #define dev_vdbg(dev, format, arg...) \ |
| 623 | { | 608 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) |
| 624 | return 0; | ||
| 625 | } | ||
| 626 | #endif | 609 | #endif |
| 627 | 610 | ||
| 628 | /* Create alias, so I can be autoloaded. */ | 611 | /* Create alias, so I can be autoloaded. */ |
