git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drivers/base: Convert dev->sem to mutex
[safe/jmp/linux-2.6]
/
include
/
linux
/
device.h
diff --git
a/include/linux/device.h
b/include/linux/device.h
index
241b96b
..
6f96191
100644
(file)
--- a/
include/linux/device.h
+++ b/
include/linux/device.h
@@
-22,7
+22,6
@@
#include <linux/types.h>
#include <linux/module.h>
#include <linux/pm.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/pm.h>
-#include <linux/semaphore.h>
#include <asm/atomic.h>
#include <asm/device.h>
#include <asm/atomic.h>
#include <asm/device.h>
@@
-404,7
+403,7
@@
struct device {
const char *init_name; /* initial name of the device */
struct device_type *type;
const char *init_name; /* initial name of the device */
struct device_type *type;
- struct
semaphore sem; /* semaphore
to synchronize calls to
+ struct
mutex mutex; /* mutex
to synchronize calls to
* its driver.
*/
* its driver.
*/
@@
-514,17
+513,17
@@
static inline bool device_async_suspend_enabled(struct device *dev)
static inline void device_lock(struct device *dev)
{
static inline void device_lock(struct device *dev)
{
-
down(&dev->sem
);
+
mutex_lock(&dev->mutex
);
}
static inline int device_trylock(struct device *dev)
{
}
static inline int device_trylock(struct device *dev)
{
- return
down_trylock(&dev->sem
);
+ return
mutex_trylock(&dev->mutex
);
}
static inline void device_unlock(struct device *dev)
{
}
static inline void device_unlock(struct device *dev)
{
-
up(&dev->sem
);
+
mutex_unlock(&dev->mutex
);
}
void driver_init(void);
}
void driver_init(void);