diff options
Diffstat (limited to 'include/linux/device.h')
| -rw-r--r-- | include/linux/device.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 241b96bcd7ad..7bb9f426f3e6 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 | ||
| @@ -203,6 +202,9 @@ struct class { | |||
| 203 | int (*suspend)(struct device *dev, pm_message_t state); | 202 | int (*suspend)(struct device *dev, pm_message_t state); |
| 204 | int (*resume)(struct device *dev); | 203 | int (*resume)(struct device *dev); |
| 205 | 204 | ||
| 205 | const struct kobj_ns_type_operations *ns_type; | ||
| 206 | const void *(*namespace)(struct device *dev); | ||
| 207 | |||
| 206 | const struct dev_pm_ops *pm; | 208 | const struct dev_pm_ops *pm; |
| 207 | 209 | ||
| 208 | struct class_private *p; | 210 | struct class_private *p; |
| @@ -404,7 +406,7 @@ struct device { | |||
| 404 | const char *init_name; /* initial name of the device */ | 406 | const char *init_name; /* initial name of the device */ |
| 405 | struct device_type *type; | 407 | struct device_type *type; |
| 406 | 408 | ||
| 407 | struct semaphore sem; /* semaphore to synchronize calls to | 409 | struct mutex mutex; /* mutex to synchronize calls to |
| 408 | * its driver. | 410 | * its driver. |
| 409 | */ | 411 | */ |
| 410 | 412 | ||
| @@ -514,17 +516,17 @@ static inline bool device_async_suspend_enabled(struct device *dev) | |||
| 514 | 516 | ||
| 515 | static inline void device_lock(struct device *dev) | 517 | static inline void device_lock(struct device *dev) |
| 516 | { | 518 | { |
| 517 | down(&dev->sem); | 519 | mutex_lock(&dev->mutex); |
| 518 | } | 520 | } |
| 519 | 521 | ||
| 520 | static inline int device_trylock(struct device *dev) | 522 | static inline int device_trylock(struct device *dev) |
| 521 | { | 523 | { |
| 522 | return down_trylock(&dev->sem); | 524 | return mutex_trylock(&dev->mutex); |
| 523 | } | 525 | } |
| 524 | 526 | ||
| 525 | static inline void device_unlock(struct device *dev) | 527 | static inline void device_unlock(struct device *dev) |
| 526 | { | 528 | { |
| 527 | up(&dev->sem); | 529 | mutex_unlock(&dev->mutex); |
| 528 | } | 530 | } |
| 529 | 531 | ||
| 530 | void driver_init(void); | 532 | void driver_init(void); |
