summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-01-14 10:06:12 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-14 10:06:12 -0200
commite8e19f179a4820f89634d39cf1e1008e8de5bda5 (patch)
treeb9562f3c1de718596c87c8d8279fa6966185eb7f
parentbbd19a63e263ada2839794825969bb63cb93e791 (diff)
downloadmediapointer-dvb-s2-e8e19f179a4820f89634d39cf1e1008e8de5bda5.tar.gz
mediapointer-dvb-s2-e8e19f179a4820f89634d39cf1e1008e8de5bda5.tar.bz2
changeset: 10235:e30767d80056
From: Trent Piepho <xyzzy@speakeasy.org> tag: tip user: Mauro Carvalho Chehab <mchehab@redhat.com> date: Wed Jan 14 09:45:53 2009 -0200 files: linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c description: USB: change interface to usb_lock_device_for_reset() backport commit 011b15df465745474e3ec85482633685933ed5a7 Author: Alan Stern <stern@rowland.harvard.edu> Date: Tue Nov 4 11:29:27 2008 -0500 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. kernel-sync: Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Acked-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 21fdc66b4..fb95a5ff1 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -3747,7 +3747,11 @@ 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 LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+ /* Due to the API changes, the ret value for success changed */
+ ret = ret != 1;
+#endif
+ if (ret == 0) {
ret = usb_reset_device(hdw->usb_dev);
usb_unlock_device(hdw->usb_dev);
} else {