From: Felipe Balbi <balbi@ti.com>
To: David Howells <dhowells@redhat.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
linux-kernel@vger.kernel.org, grant@secretlab.ca,
ralf@linux-mips.org
Subject: Re: [PATCH] FRV: Hook up gpiolib support
Date: Fri, 17 Jun 2011 13:54:44 +0300 [thread overview]
Message-ID: <20110617105443.GP12230@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <28714.1308307859@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2409 bytes --]
On Fri, Jun 17, 2011 at 11:50:59AM +0100, David Howells wrote:
> Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
>
> > And to repeat what I said: the generic header prototypes everything it
> > needs before it uses it so there should be no problem here, it's not
> > been a problem on the other architectures using this code verbatim.
> > Please be more specific.
>
> Okay:
>
> CC drivers/mtd/maps/gpio-addr-flash.o
> In file included from /data/frv/linux-2.6-frv/arch/frv/include/asm/gpio.h:21,
> from include/linux/gpio.h:8,
> from drivers/mtd/maps/gpio-addr-flash.c:17:
> include/asm-generic/gpio.h: In function 'gpio_get_value_cansleep':
> include/asm-generic/gpio.h:233: error: implicit declaration of function 'gpio_get_value'
> include/asm-generic/gpio.h: In function 'gpio_set_value_cansleep':
> include/asm-generic/gpio.h:239: error: implicit declaration of function 'gpio_set_value'
> drivers/mtd/maps/gpio-addr-flash.c: In function 'gpio_flash_probe':
> drivers/mtd/maps/gpio-addr-flash.c:234: error: implicit declaration of function 'gpio_request'
> drivers/mtd/maps/gpio-addr-flash.c:238: error: implicit declaration of function 'gpio_free'
> drivers/mtd/maps/gpio-addr-flash.c:242: error: implicit declaration of function 'gpio_direction_output'
>
>
> Let me expand on my explanation earlier:
>
> (1) asm-generic/gpio.h has an _inline_ function:
>
> static inline int gpio_get_value_cansleep(unsigned gpio)
> {
> might_sleep();
> return gpio_get_value(gpio);
> }
>
> (2) gpio_get_value() is implemented in asm/gpio.h. It is not declared in
> asm-generic/gpio.h.
>
> (3) Therefore, the #inclusion of asm-generic/gpio.h must come _after_ the
> implementation of gpio_get_value() in asm/gpio.h.
>
> (4) asm/gpio.h implements the aforementioned inline function:
>
> static inline int gpio_get_value(unsigned int gpio)
> {
> return __gpio_get_value(gpio);
> }
>
> (5) __gpio_get_value() is declared in asm-generic/gpio.h. It is not declared
> in asm/gpio.h.
>
> (6) Therefore, the #inclusion of asm/gpio.h must come _before_ the
> implementation of gpio_get_value() in asm/gpio.h.
>
> Thus (3) and (6) contradict.
sounds like it's time to move all that mess to one header alone ?!?
<linux/gpio.h> should be self-sufficient ?
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2011-06-17 10:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-01 9:49 [PATCH] FRV: Hook up gpiolib support Mark Brown
2011-06-01 20:19 ` Grant Likely
2011-06-14 18:08 ` David Howells
2011-06-15 14:48 ` Mark Brown
2011-06-16 6:36 ` David Howells
2011-06-16 10:22 ` Mark Brown
2011-06-17 10:50 ` David Howells
2011-06-17 10:54 ` Felipe Balbi [this message]
2011-06-17 12:18 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110617105443.GP12230@legolas.emea.dhcp.ti.com \
--to=balbi@ti.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dhowells@redhat.com \
--cc=grant@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).