diff options
Diffstat (limited to 'include/linux/device.h')
| -rw-r--r-- | include/linux/device.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index cd7534cc42ab..0713e10571dd 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
| 23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
| 24 | #include <linux/pm.h> | 24 | #include <linux/pm.h> |
| 25 | #include <linux/semaphore.h> | ||
| 26 | #include <asm/atomic.h> | 25 | #include <asm/atomic.h> |
| 27 | #include <asm/device.h> | 26 | #include <asm/device.h> |
| 28 | 27 | ||
| @@ -208,6 +207,9 @@ struct class { | |||
| 208 | int (*suspend)(struct device *dev, pm_message_t state); | 207 | int (*suspend)(struct device *dev, pm_message_t state); |
| 209 | int (*resume)(struct device *dev); | 208 | int (*resume)(struct device *dev); |
| 210 | 209 | ||
| 210 | const struct kobj_ns_type_operations *ns_type; | ||
| 211 | const void *(*namespace)(struct device *dev); | ||
| 212 | |||
| 211 | const struct dev_pm_ops *pm; | 213 | const struct dev_pm_ops *pm; |
| 212 | 214 | ||
| 213 | struct class_private *p; | 215 | struct class_private *p; |
| @@ -409,7 +411,7 @@ struct device { | |||
| 409 | const char *init_name; /* initial name of the device */ | 411 | const char *init_name; /* initial name of the device */ |
| 410 | struct device_type *type; | 412 | struct device_type *type; |
| 411 | 413 | ||
| 412 | struct semaphore sem; /* semaphore to synchronize calls to | 414 | struct mutex mutex; /* mutex to synchronize calls to |
| 413 | * its driver. | 415 | * its driver. |
| 414 | */ | 416 | */ |
| 415 | 417 | ||
| @@ -459,6 +461,10 @@ struct device { | |||
| 459 | 461 | ||
| 460 | static inline const char *dev_name(const struct device *dev) | 462 | static inline const char *dev_name(const struct device *dev) |
| 461 | { | 463 | { |
| 464 | /* Use the init name until the kobject becomes available */ | ||
| 465 | if (dev->init_name) | ||
| 466 | return dev->init_name; | ||
| 467 | |||
| 462 | return kobject_name(&dev->kobj); | 468 | return kobject_name(&dev->kobj); |
| 463 | } | 469 | } |
| 464 | 470 | ||
| @@ -518,17 +524,17 @@ static inline bool device_async_suspend_enabled(struct device *dev) | |||
| 518 | 524 | ||
| 519 | static inline void device_lock(struct device *dev) | 525 | static inline void device_lock(struct device *dev) |
| 520 | { | 526 | { |
| 521 | down(&dev->sem); | 527 | mutex_lock(&dev->mutex); |
| 522 | } | 528 | } |
| 523 | 529 | ||
| 524 | static inline int device_trylock(struct device *dev) | 530 | static inline int device_trylock(struct device *dev) |
| 525 | { | 531 | { |
| 526 | return down_trylock(&dev->sem); | 532 | return mutex_trylock(&dev->mutex); |
| 527 | } | 533 | } |
| 528 | 534 | ||
| 529 | static inline void device_unlock(struct device *dev) | 535 | static inline void device_unlock(struct device *dev) |
| 530 | { | 536 | { |
| 531 | up(&dev->sem); | 537 | mutex_unlock(&dev->mutex); |
| 532 | } | 538 | } |
| 533 | 539 | ||
| 534 | void driver_init(void); | 540 | void driver_init(void); |
