diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-06-26 10:19:54 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-06-26 10:19:54 +1000 |
commit | 0779ac7043e85d9fa1afab8089804e621cc517d8 (patch) | |
tree | ee628a1fa6046887ba9cb02bc7c0820ee4a6cf74 | |
parent | 78f62cd6b0d89037196c9ebdc14f230f394001ca (diff) |
misc:down_nowait-drivers_usb_core_usb
down_trylock -> down_try for usb_trylock_device()
I took the liberty of reversing the sense of usb_trylock_device(): it only
has one user anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | drivers/usb/core/usb.c | 2 | ||||
-rw-r--r-- | include/linux/usb.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 325774375837..2f76846e1c60 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -478,7 +478,7 @@ int usb_lock_device_for_reset(struct usb_device *udev, } } - 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 */ diff --git a/include/linux/usb.h b/include/linux/usb.h index c08689ea9b4b..ea2c2ecafb8d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -491,7 +491,7 @@ extern void usb_put_dev(struct usb_device *dev); /* USB device locking */ #define usb_lock_device(udev) down(&(udev)->dev.sem) #define usb_unlock_device(udev) up(&(udev)->dev.sem) -#define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem) +#define usb_trylock_device(udev) down_try(&(udev)->dev.sem) extern int usb_lock_device_for_reset(struct usb_device *udev, const struct usb_interface *iface); |