From patchwork Fri Jan 9 04:47:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 1447 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 n094ilww020490 for ; Thu, 8 Jan 2009 20:44:48 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752728AbZAIEs2 (ORCPT ); Thu, 8 Jan 2009 23:48:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753254AbZAIEs2 (ORCPT ); Thu, 8 Jan 2009 23:48:28 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:57376 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752728AbZAIEs2 (ORCPT ); Thu, 8 Jan 2009 23:48:28 -0500 Received: from [200.220.139.66] (helo=pedra.chehab.org) by bombadil.infradead.org with esmtpsa (Exim 4.68 #1 (Red Hat Linux)) id 1LL9IH-0004rR-93; Fri, 09 Jan 2009 04:48:25 +0000 Date: Fri, 9 Jan 2009 02:47:58 -0200 From: Mauro Carvalho Chehab To: Mike Isely Cc: isely@isely.net, Linux Media Mailing List Subject: Re: USB: change interface to usb_lock_device_for_reset() Message-ID: <20090109024758.6c4902f6@pedra.chehab.org> In-Reply-To: References: <20090108235304.46ac523b@pedra.chehab.org> <20090109023842.4a6c638c@pedra.chehab.org> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.10.4; x86_64-redhat-linux-gnu) Mime-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Thu, 8 Jan 2009 22:42:41 -0600 (CST) Mike Isely wrote: > On Fri, 9 Jan 2009, Mauro Carvalho Chehab wrote: > > > On Thu, 8 Jan 2009 22:28:18 -0600 (CST) > > Mike Isely wrote: > > > > > On Thu, 8 Jan 2009, Mike Isely wrote: > > > > > > > > > > > > > > > On Thu, 8 Jan 2009, Mauro Carvalho Chehab wrote: > > > > > > > > > Hi Mike, > > > > > > > > > > There were an upstream change usb_lock_device_for_reset() that touched on > > > > > pvrusb2 driver. I didn't backport it yet, since I'm not sure if the change is > > > > > ok. Could you please check? > > > > > > > > > > Thanks, > > > > > Mauro. > > > > > > > > Yes, the pvrusb2 part of this change looks fine (just change the > > > > treatment of the return code). > > > > > > Before I cause any confusion, the above sentence has a critical typo. > > > I was just pointing out that the pvrusb2 change in the patch below only > > > adjusts the treatment of the return code, which makes perfect sense > > > given the upstream change. I wasn't asking you to change anything :-) > > > The change is fine. > > > > Ok. The backport of this patch would be something interesting... > > > > It will be something like this: > > > > #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29) > > if (ret == 0) > > #else > > if (ret == 1) > > #endif > > > > Yeah, I know. It's part of the fun of staying in sync with multiple > kernels and their ever-changing internal interfaces. I have to support > this in the standalone pvrusb2 driver too. One more task this > weekend... 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. Now, I need to rest for a while. it is almost 3am here... Cheers, Mauro. Cheers, Mauro Acked-By: Mike Isely --- 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 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 {