linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: rabin@rab.in (Rabin Vincent)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Fix U300 generic GPIO, remove ifdefs from MMCI
Date: Mon, 28 Sep 2009 07:16:28 +0530	[thread overview]
Message-ID: <20090928014628.GA15318@debian> (raw)
In-Reply-To: <1254078501-11745-1-git-send-email-linus.walleij@stericsson.com>

On Sun, Sep 27, 2009 at 09:08:21PM +0200, Linus Walleij wrote:
> The #ifdefs in the MMCI driver were erroneous and just masking
> a bug in the U300 generic GPIO implementation. This removes the
> ifdefs and fixes the U300 generic GPIO instead.
> 
> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
> ---
>  arch/arm/mach-u300/gpio.c              |    8 ++++++++
>  arch/arm/mach-u300/include/mach/gpio.h |    1 +
>  drivers/mmc/host/mmci.c                |    2 --
>  3 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-u300/gpio.c b/arch/arm/mach-u300/gpio.c
> index 63c8f27..ce268ef 100644
> --- a/arch/arm/mach-u300/gpio.c
> +++ b/arch/arm/mach-u300/gpio.c
> @@ -281,6 +281,14 @@ int gpio_unregister_callback(unsigned gpio)
>  }
>  EXPORT_SYMBOL(gpio_unregister_callback);
>  
> +int gpio_is_valid(int number)
> +{
> +	if (number < (U300_GPIO_NUM_PORTS * U300_GPIO_PINS_PER_PORT))
> +		return 0;
> +	return -EINVAL;
> +}

gpio_is_valid() should return non-zero if the GPIO is valid, and zero
if it's not.   Also, number may be negative so this function needs to
check for that.

Rabin

      reply	other threads:[~2009-09-28  1:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-27 19:08 [PATCH] Fix U300 generic GPIO, remove ifdefs from MMCI Linus Walleij
2009-09-28  1:46 ` Rabin Vincent [this message]

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=20090928014628.GA15318@debian \
    --to=rabin@rab.in \
    --cc=linux-arm-kernel@lists.infradead.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).