From 011b15df465745474e3ec85482633685933ed5a7 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Tue, 4 Nov 2008 11:29:27 -0500 Subject: USB: change interface to usb_lock_device_for_reset() This patch (as1161) changes the interface to usb_lock_device_for_reset(). The existing interface is apparently not very clear, judging from the fact that several of its callers don't use it correctly. The new interface always returns 0 for success and it always requires the caller to unlock the device afterward. The new routine will not return immediately if it is called while the driver's probe method is running. Instead it will wait until the probe is over and the device has been unlocked. This shouldn't cause any problems; I don't know of any cases where drivers call usb_lock_device_for_reset() during probe. Signed-off-by: Alan Stern Cc: Pete Zaitcev Signed-off-by: Greg Kroah-Hartman --- drivers/media/video/pvrusb2/pvrusb2-hdw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media') diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 8fb92ac78c7b..fa304e5f252a 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -3655,7 +3655,7 @@ void pvr2_hdw_device_reset(struct pvr2_hdw *hdw) int ret; pvr2_trace(PVR2_TRACE_INIT,"Performing a device reset..."); ret = usb_lock_device_for_reset(hdw->usb_dev,NULL); - if (ret == 1) { + if (ret == 0) { ret = usb_reset_device(hdw->usb_dev); usb_unlock_device(hdw->usb_dev); } else { -- cgit v1.2.3