All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Tony Lindgren <tony@atomide.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>
Cc: linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Javier Martinez Canillas <javier@dowhile0.org>,
	Kevin Hilman <khilman@deeprootsystems.com>,
	Santosh Shilimkar <ssantosh@kernel.org>
Subject: Re: [PATCH] gpio: omap: Fix GPIO numbering for deferred probe
Date: Fri, 4 Sep 2015 13:00:38 +0300	[thread overview]
Message-ID: <55E96BC6.1040003@ti.com> (raw)
In-Reply-To: <1441301487-6238-1-git-send-email-tony@atomide.com>

On 09/03/2015 08:31 PM, Tony Lindgren wrote:
> If gpio-omap probe fails with -EPROBE_DEFER, the GPIO numbering
> keeps increasing. Only increase the gpio count if gpiochip_add()
> was successful as otherwise the numbers will increase for each
> probe attempt.
>
> Cc: Grygorii Strashko <grygorii.strashko@ti.com>
> Cc: Javier Martinez Canillas <javier@dowhile0.org>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
> Cc: Santosh Shilimkar <ssantosh@kernel.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>   drivers/gpio/gpio-omap.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1095,7 +1095,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
>   	} else {
>   		bank->chip.label = "gpio";
>   		bank->chip.base = gpio;
> -		gpio += bank->width;
>   	}
>   	bank->chip.ngpio = bank->width;
>
> @@ -1105,6 +1104,9 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
>   		return ret;
>   	}
>
> +	if (!bank->is_mpuio)
> +		gpio += bank->width;
> +
>   #ifdef CONFIG_ARCH_OMAP1
>   	/*
>   	 * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop
>

Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>

With hope that only GPIO0 will be deferred, otherwise
there will be total mess in gpios enumeration ;)

-- 
regards,
-grygorii

WARNING: multiple messages have this Message-ID (diff)
From: grygorii.strashko@ti.com (Grygorii Strashko)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] gpio: omap: Fix GPIO numbering for deferred probe
Date: Fri, 4 Sep 2015 13:00:38 +0300	[thread overview]
Message-ID: <55E96BC6.1040003@ti.com> (raw)
In-Reply-To: <1441301487-6238-1-git-send-email-tony@atomide.com>

On 09/03/2015 08:31 PM, Tony Lindgren wrote:
> If gpio-omap probe fails with -EPROBE_DEFER, the GPIO numbering
> keeps increasing. Only increase the gpio count if gpiochip_add()
> was successful as otherwise the numbers will increase for each
> probe attempt.
>
> Cc: Grygorii Strashko <grygorii.strashko@ti.com>
> Cc: Javier Martinez Canillas <javier@dowhile0.org>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
> Cc: Santosh Shilimkar <ssantosh@kernel.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>   drivers/gpio/gpio-omap.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1095,7 +1095,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
>   	} else {
>   		bank->chip.label = "gpio";
>   		bank->chip.base = gpio;
> -		gpio += bank->width;
>   	}
>   	bank->chip.ngpio = bank->width;
>
> @@ -1105,6 +1104,9 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
>   		return ret;
>   	}
>
> +	if (!bank->is_mpuio)
> +		gpio += bank->width;
> +
>   #ifdef CONFIG_ARCH_OMAP1
>   	/*
>   	 * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop
>

Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>

With hope that only GPIO0 will be deferred, otherwise
there will be total mess in gpios enumeration ;)

-- 
regards,
-grygorii

  reply	other threads:[~2015-09-04 10:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03 17:31 [PATCH] gpio: omap: Fix GPIO numbering for deferred probe Tony Lindgren
2015-09-03 17:31 ` Tony Lindgren
2015-09-04 10:00 ` Grygorii Strashko [this message]
2015-09-04 10:00   ` Grygorii Strashko
2015-09-04 23:52   ` Tony Lindgren
2015-09-04 23:52     ` Tony Lindgren
2015-09-08 14:14 ` Linus Walleij
2015-09-08 14:14   ` Linus Walleij

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=55E96BC6.1040003@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=gnurou@gmail.com \
    --cc=javier@dowhile0.org \
    --cc=khilman@deeprootsystems.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=tony@atomide.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.