Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196042
b: refs/heads/master
c: 3142788
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Greg Kroah-Hartman committed May 21, 2010
1 parent 3b47580 commit 3cb2196
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 190e8370b8033f746db5289e9324174564a6f5a7
refs/heads/master: 3142788b7967ccfd2f1813ee9e11aeb1e1cf7de2
3 changes: 1 addition & 2 deletions trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <linux/notifier.h>
#include <linux/genhd.h>
#include <linux/kallsyms.h>
#include <linux/semaphore.h>
#include <linux/mutex.h>
#include <linux/async.h>

Expand Down Expand Up @@ -559,7 +558,7 @@ void device_initialize(struct device *dev)
dev->kobj.kset = devices_kset;
kobject_init(&dev->kobj, &device_ktype);
INIT_LIST_HEAD(&dev->dma_pools);
init_MUTEX(&dev->sem);
mutex_init(&dev->mutex);
spin_lock_init(&dev->devres_lock);
INIT_LIST_HEAD(&dev->devres_head);
device_pm_init(dev);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/mlx4/mlx4.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <linux/mutex.h>
#include <linux/radix-tree.h>
#include <linux/timer.h>
#include <linux/semaphore.h>
#include <linux/workqueue.h>

#include <linux/mlx4/device.h>
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/staging/comedi/drivers/quatech_daqp_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Devices: [Quatech] DAQP-208 (daqp), DAQP-308
*/

#include "../comedidev.h"
#include <linux/semaphore.h>

#include <pcmcia/cs_types.h>
#include <pcmcia/cs.h>
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/usb/core/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ int usb_lock_device_for_reset(struct usb_device *udev,
iface->condition == USB_INTERFACE_UNBOUND))
return -EINTR;

while (usb_trylock_device(udev) != 0) {
while (!usb_trylock_device(udev)) {

/* If we can't acquire the lock after waiting one second,
* we're probably deadlocked */
Expand Down
9 changes: 4 additions & 5 deletions trunk/include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <linux/types.h>
#include <linux/module.h>
#include <linux/pm.h>
#include <linux/semaphore.h>
#include <asm/atomic.h>
#include <asm/device.h>

Expand Down Expand Up @@ -404,7 +403,7 @@ struct device {
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.
*/

Expand Down Expand Up @@ -514,17 +513,17 @@ static inline bool device_async_suspend_enabled(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)
{
return down_trylock(&dev->sem);
return mutex_trylock(&dev->mutex);
}

static inline void device_unlock(struct device *dev)
{
up(&dev->sem);
mutex_unlock(&dev->mutex);
}

void driver_init(void);
Expand Down

0 comments on commit 3cb2196

Please sign in to comment.