1USB_LOCK_DEVICE_FOR_(9)          USB Core APIs         USB_LOCK_DEVICE_FOR_(9)
2
3
4

NAME

6       usb_lock_device_for_reset - cautiously acquire the lock for a usb
7       device structure
8

SYNOPSIS

10       int usb_lock_device_for_reset(struct usb_device * udev,
11                                     const struct usb_interface * iface);
12

ARGUMENTS

14       udev
15           device that's being locked
16
17       iface
18           interface bound to the driver making the request (optional)
19

DESCRIPTION

21       Attempts to acquire the device lock, but fails if the device is
22       NOTATTACHED or SUSPENDED, or if iface is specified and the interface is
23       neither BINDING nor BOUND. Rather than sleeping to wait for the lock,
24       the routine polls repeatedly. This is to prevent deadlock with
25       disconnect; in some drivers (such as usb-storage) the disconnect or
26       suspend method will block waiting for a device reset to complete.
27
28       Returns a negative error code for failure, otherwise 0.
29
31Kernel Hackers Manual 2.6.       November 2011         USB_LOCK_DEVICE_FOR_(9)
Impressum