devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Steven King <sfking-xS0NTnu2YfYAvxtiuMwx3w@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH] of/gpio: add declaration of struct gpio_chip to silence warning if CONFIG_OF_GPIO=n && CONFIG_GPIOLIB=n
Date: Mon, 21 May 2012 03:32:58 -0700	[thread overview]
Message-ID: <20120521103257.GA9328@lizard> (raw)
In-Reply-To: <201205201639.21378.sfking-xS0NTnu2YfYAvxtiuMwx3w@public.gmane.org>

On Sun, May 20, 2012 at 04:39:21PM -0700, Steven King wrote:
> The stubs for when CONFIG_OF_GPIO =n reference struct gpio_chip.  If
> CONFIG_GPIOLIB=n, the warning 'include/linux/of_gpio.h:83: warning: 'struct
> gpio_chip' declared inside parameter list' is given.  Make it go away.
> 
> Signed-off-by: Steven King <sfking-xS0NTnu2YfYAvxtiuMwx3w@public.gmane.org>
> ---

Hm. We have linux/gpio.h, it should provide 'struct gpio_chip'
stub, so that the code that tries to use generic GPIO would
always work (like of_gpio.h). So, no, this forward-declration
should be provided by linux/gpio.h.

And we do provide it, for GENERIC_GPIO=n case. And it
seems that you have GPIOLIB=n, but GENERIC_GPIO=y? That's
strage. What archictecure is this? Can you tell the exact
kernel version and may be give a config file that you
used to reproduce the warning?

Thanks!

>  include/linux/of_gpio.h |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
> index 81733d1..5b37613 100644
> --- a/include/linux/of_gpio.h
> +++ b/include/linux/of_gpio.h
> @@ -65,6 +65,8 @@ extern int of_gpio_simple_xlate(struct gpio_chip *gc,
>  
>  #else /* CONFIG_OF_GPIO */
>  
> +struct gpio_chip;
> +
>  /* Drivers may not strictly depend on the GPIO support, so let them link. */
>  static inline int of_get_named_gpio_flags(struct device_node *np,
>  		const char *list_name, int index, enum of_gpio_flags *flags)

-- 
Anton Vorontsov
Email: cbouatmailru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

       reply	other threads:[~2012-05-21 10:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201205201639.21378.sfking@fdwdc.com>
     [not found] ` <201205201639.21378.sfking-xS0NTnu2YfYAvxtiuMwx3w@public.gmane.org>
2012-05-21 10:32   ` Anton Vorontsov [this message]
     [not found]     ` <201205210950.59719.sfking@fdwdc.com>
     [not found]       ` <201205210950.59719.sfking-xS0NTnu2YfYAvxtiuMwx3w@public.gmane.org>
2012-05-22  0:54         ` [PATCH] of/gpio: add declaration of struct gpio_chip to silence warning if CONFIG_OF_GPIO=n && CONFIG_GPIOLIB=n Anton Vorontsov

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=20120521103257.GA9328@lizard \
    --to=cbouatmailru-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=sfking-xS0NTnu2YfYAvxtiuMwx3w@public.gmane.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).