drivers/base: Convert dev->sem to mutex
The semaphore is semantically a mutex. Convert it to a real mutex and fix up a few places where code was relying on semaphore.h to be included by device.h, as well as the users of the trylock function, as that value is now reversed. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
190e8370b8
commit
3142788b79
@@ -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 */
|
||||
|
Reference in New Issue
Block a user