diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-21 18:49:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-21 18:49:58 -0400 |
commit | e80ab411e589e00550e2e6e5a6a02d59cc730357 (patch) | |
tree | 870225ff7b5b8d03e82a996963213a4bb9cce248 /include/linux/device.h | |
parent | 529a41e36673b518c9e091f3a8d932b6b9e3c461 (diff) | |
parent | ee959b00c335d7780136c5abda37809191fe52c3 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits)
SCSI: convert struct class_device to struct device
DRM: remove unused dev_class
IB: rename "dev" to "srp_dev" in srp_host structure
IB: convert struct class_device to struct device
memstick: convert struct class_device to struct device
driver core: replace remaining __FUNCTION__ occurrences
sysfs: refill attribute buffer when reading from offset 0
PM: Remove destroy_suspended_device()
Firmware: add iSCSI iBFT Support
PM: Remove legacy PM (fix)
Kobject: Replace list_for_each() with list_for_each_entry().
SYSFS: Explicitly include required header file slab.h.
Driver core: make device_is_registered() work for class devices
PM: Convert wakeup flag accessors to inline functions
PM: Make wakeup flags available whenever CONFIG_PM is set
PM: Fix misuse of wakeup flag accessors in serial core
Driver core: Call device_pm_add() after bus_add_device() in device_add()
PM: Handle device registrations during suspend/resume
block: send disk "change" event for rescan_partitions()
sysdev: detect multiple driver registrations
...
Fixed trivial conflict in include/linux/memory.h due to semaphore header
file change (made irrelevant by the change to mutex).
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. */ |