From patchwork Fri Jan 9 05:56:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trent Piepho X-Patchwork-Id: 1452 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n095qKA0023891 for ; Thu, 8 Jan 2009 21:52:35 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752759AbZAIF4R (ORCPT ); Fri, 9 Jan 2009 00:56:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752817AbZAIF4Q (ORCPT ); Fri, 9 Jan 2009 00:56:16 -0500 Received: from mail2.sea5.speakeasy.net ([69.17.117.4]:46802 "EHLO mail2.sea5.speakeasy.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752759AbZAIF4Q (ORCPT ); Fri, 9 Jan 2009 00:56:16 -0500 Received: (qmail 31184 invoked from network); 9 Jan 2009 05:56:15 -0000 Received: from shell2.sea5.speakeasy.net ([69.17.116.3]) (envelope-sender ) by mail2.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 9 Jan 2009 05:56:15 -0000 Date: Thu, 8 Jan 2009 21:56:15 -0800 (PST) From: Trent Piepho X-X-Sender: xyzzy@shell2.speakeasy.net To: Mike Isely cc: Mauro Carvalho Chehab , Linux Media Mailing List Subject: Re: USB: change interface to usb_lock_device_for_reset() In-Reply-To: Message-ID: References: <20090108235304.46ac523b@pedra.chehab.org> <20090109023842.4a6c638c@pedra.chehab.org> <20090109024758.6c4902f6@pedra.chehab.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Thu, 8 Jan 2009, Mike Isely wrote: > > Yes... Anyway, this is the real patch. I've added a small comment about this > > change... I'll commit this tomorrow, if you don't have a better suggestion. > > Looks good. Or maybe like this? > > diff -r f01b3897d141 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c > > --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Jan 09 00:27:32 2009 -0200 > > +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Jan 09 02:45:48 2009 -0200 > > @@ -3747,7 +3747,12 @@ > > int ret; > > pvr2_trace(PVR2_TRACE_INIT,"Performing a device reset..."); > > ret = usb_lock_device_for_reset(hdw->usb_dev,NULL); > > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29) > > + if (ret == 0) { > > +#else > > + /* Due to the API changes, the ret value for success changed */ > > if (ret == 1) { > > +#endif > > ret = usb_reset_device(hdw->usb_dev); > > usb_unlock_device(hdw->usb_dev); > > } else { Acked-By: Mike Isely Signed-off-by: Trent Piepho --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -r f01b3897d141 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Jan 09 00:27:32 2009 -0200 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Jan 09 02:45:48 2009 -0200 @@ -3747,7 +3747,12 @@ 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 {