Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965457AbYCSVEG (ORCPT ); Wed, 19 Mar 2008 17:04:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760695AbYCSTyY (ORCPT ); Wed, 19 Mar 2008 15:54:24 -0400 Received: from mail.gmx.net ([213.165.64.20]:56789 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1760686AbYCSTyS convert rfc822-to-8bit (ORCPT ); Wed, 19 Mar 2008 15:54:18 -0400 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX18D0/Y0qEoDw14HcnHD4WVoBxGjHEfpkZSt5o83vh 9qKauQCDgJubt+ Date: Tue, 18 Mar 2008 17:31:16 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= cc: David Brownell , linux-kernel@vger.kernel.org Subject: Re: gpio patches in mmotm In-Reply-To: <20080318160316.GA31588@digi.com> Message-ID: References: <20080317173134.GA27282@digi.com> <20080318160316.GA31588@digi.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=KOI8-R Content-Transfer-Encoding: 8BIT X-Y-GMX-Trusted: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1648 Lines: 40 Please, do not trim the CC: list. I've also added lkml. On Tue, 18 Mar 2008, Uwe Kleine-K?nig wrote: > Guennadi Liakhovetski wrote: > > On Mon, 17 Mar 2008, Uwe Kleine-K?nig wrote: > > > > > I'm nure sure if I like gpio_is_valid(). When do you think it should be > > > used? (i.e. in which situations gpio_request doesn't do the right > > > thing?) > > > > For example, in situations similar to what I have in mt9m001 and mt9v022 > > camera drivers. Those cameras can be built with an i2c gpio extender, > > which can be used to switch between 8 and 10 bit data bus widths. But that > > extender is not always available. So, those drivers request a gpio, and if > > it is not available on the system, the gpio_is_valid() test fails. > I found your patch, but no tree where it applies. Can you point me to a > tree where it applies? These drivers are currently in the v4l-dvb tree http://git.kernel.org/?p=linux/kernel/git/mchehab/v4l-dvb.git;a=summary in the devel branch. > Why isn't it enough that gpio_request fails in such a situation? I'm storing the GPIO number locally, and if the system doesn't have a valid GPIO for me, I'm storing an invalid GPIO number. Then at any time if the GPIO has to be used, I just verify if gpio_is_valid(), and if not, return an error code for this request, but the driver remains otherwise functional. Thanks Guennadi --- Guennadi Liakhovetski -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/