From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp117.sbc.mail.sp1.yahoo.com (smtp117.sbc.mail.sp1.yahoo.com [69.147.64.90]) by ozlabs.org (Postfix) with SMTP id 7A259DDE36 for ; Sat, 23 Feb 2008 10:42:06 +1100 (EST) From: David Brownell To: cbouatmailru@gmail.com, avorontsov@ru.mvista.com Subject: Re: [PATCH RFC 4/7] [GPIO] Let drivers link if they support GPIO API as an addition Date: Fri, 22 Feb 2008 15:42:03 -0800 References: <20071210204705.GA31263@localhost.localdomain> <20071210225525.2F6C6266154@adsl-69-226-248-13.dsl.pltn13.pacbell.net> <20071210230445.GA1141@zarina> In-Reply-To: <20071210230445.GA1141@zarina> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Message-Id: <200802221542.03359.david-b@pacbell.net> Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Monday 10 December 2007, Anton Vorontsov wrote: > On Mon, Dec 10, 2007 at 02:55:24PM -0800, David Brownell wrote: > > The point of CONFIG_GENERIC_GPIO is to be *the* conditional used to > > tell whether that programming interface is available ... starting > > from "#include ", and including all gpio_*() calls. > > > > So my first reaction is to not like this patch. It changes semantics > > in an incompatible way. And AFAICT, needlessly so. > > Why incompatible? gpio-aware drivers will get -ENOSYS on gpio_request, > thus they will not do anything wrong. GPIO-only drivers could still > depend on GENERIC_GPIO, and their behaviour will not change. If you still want this, I think a better approach would be: http://marc.info/?l=linux-kernel&m=120295461410848&w=2 That is, #include and have *that* do the relevant switch, based on GENERIC_GPIO. No semantic changes at all, if one discounts the implicit switch to (important for platforms that don't *have* any header), which won't affect any existing code. So your NAND code could use that, and work equally well on SOC variants that have generic GPIOs and those that don't. Comments? - Dave