aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 241b96bcd7ad..6f9619190aaf 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
@@ -404,7 +403,7 @@ struct device {
404 const char *init_name; /* initial name of the device */ 403 const char *init_name; /* initial name of the device */
405 struct device_type *type; 404 struct device_type *type;
406 405
407 struct semaphore sem; /* semaphore to synchronize calls to 406 struct mutex mutex; /* mutex to synchronize calls to
408 * its driver. 407 * its driver.
409 */ 408 */
410 409
@@ -514,17 +513,17 @@ static inline bool device_async_suspend_enabled(struct device *dev)
514 513
515static inline void device_lock(struct device *dev) 514static inline void device_lock(struct device *dev)
516{ 515{
517 down(&dev->sem); 516 mutex_lock(&dev->mutex);
518} 517}
519 518
520static inline int device_trylock(struct device *dev) 519static inline int device_trylock(struct device *dev)
521{ 520{
522 return down_trylock(&dev->sem); 521 return mutex_trylock(&dev->mutex);
523} 522}
524 523
525static inline void device_unlock(struct device *dev) 524static inline void device_unlock(struct device *dev)
526{ 525{
527 up(&dev->sem); 526 mutex_unlock(&dev->mutex);
528} 527}
529 528
530void driver_init(void); 529void driver_init(void);