public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roland Stigge <stigge@antcom.de>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] gpio/lpc32xx: Fixup of_xlate for core changes
Date: Fri, 18 May 2012 10:08:42 +0200	[thread overview]
Message-ID: <4FB6038A.90201@antcom.de> (raw)
In-Reply-To: <1337285060-31919-3-git-send-email-grant.likely@secretlab.ca>

On 05/17/2012 10:04 PM, Grant Likely wrote:
> Hi Roland,
> 
> I've reworked the of_xlate code for gpios in a way that I'm happier with, but it is untested.  Can you try it out with this patch to your code and make sure it works properly for you?  You can roll this change into your patch if it works.
> 
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> Cc: Roland Stigge <stigge@antcom.de>

(After fixing the typo below.)

Tested-by: Roland Stigge <stigge@antcom.de>

> ---
>  drivers/gpio/gpio-lpc32xx.c |   13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-lpc32xx.c b/drivers/gpio/gpio-lpc32xx.c
> index d42bf6c..6ea7b38 100644
> --- a/drivers/gpio/gpio-lpc32xx.c
> +++ b/drivers/gpio/gpio-lpc32xx.c
> @@ -464,18 +464,15 @@ void __init lpc32xx_gpio_init(void)
>  {
>  }
>  
> -static int lpc32xx_of_xlate(struct gpio_chip **gc,
> +static int lpc32xx_of_xlate(struct gpio_chip *gc,
>  			    const struct of_phandle_args *gpiospec, u32 *flags)
>  {
> -	u32 bank;
> -	if (WARN_ON(gpiospec->args_count < 3))
> +	/* Is this the correct bank? */
> +	u32 bank = gpiospec->args[0];
> +	if ((bank > ARRAY_SIZE(lpc32xx_gpiochip) ||
> +	    (gc != &lpc32xx_gpiochip[bank].chip))

One final closing parenthesis is missing here.

>  		return -EINVAL;
>  
> -	bank = gpiospec->args[0];
> -	if (WARN_ON(bank > 5))
> -		return -EINVAL;
> -
> -	*gc = &lpc32xx_gpiochip[bank].chip;
>  	if (flags)
>  		*flags = gpiospec->args[2];
>  	return gpiospec->args[1];


  reply	other threads:[~2012-05-18  8:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17 20:04 [PATCH 1/3] gpio: Adjust of_xlate API to support multiple GPIO chips Grant Likely
2012-05-17 20:04 ` [PATCH 2/3] gpio/lpc32xx: Add device tree support Grant Likely
2012-05-17 20:10   ` Grant Likely
2012-05-17 20:04 ` [PATCH 3/3] gpio/lpc32xx: Fixup of_xlate for core changes Grant Likely
2012-05-18  8:08   ` Roland Stigge [this message]
2012-05-17 20:10 ` [PATCH 1/3] gpio: Adjust of_xlate API to support multiple GPIO chips Grant Likely
2012-05-18  8:05 ` Roland Stigge
2012-05-18  8:06 ` Roland Stigge
2012-05-18  8:17 ` [PATCH 2/2] gpio: Device tree support for LPC32xx Roland Stigge
2012-05-18  8:18 ` Roland Stigge

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=4FB6038A.90201@antcom.de \
    --to=stigge@antcom.de \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.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