linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] gpio: mvebu: make mvchip->irqbase signed for error handling
@ 2013-11-07  7:50 Dan Carpenter
  2013-11-18 10:40 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-11-07  7:50 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Grant Likely, Rob Herring, linux-gpio, kernel-janitors

There is a bug in mvebu_gpio_probe() where we do:

	mvchip->irqbase = irq_alloc_descs(-1, 0, ngpios, -1);
	if (mvchip->irqbase < 0) {

The problem is that mvchip->irqbase is unsigned so the error handling
doesn't work.  I have changed it to be a regular int.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 3c3321f..db31290 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -79,7 +79,7 @@ struct mvebu_gpio_chip {
 	spinlock_t	   lock;
 	void __iomem	  *membase;
 	void __iomem	  *percpu_membase;
-	unsigned int       irqbase;
+	int		   irqbase;
 	struct irq_domain *domain;
 	int                soc_variant;
 };

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] gpio: mvebu: make mvchip->irqbase signed for error handling
  2013-11-07  7:50 [patch] gpio: mvebu: make mvchip->irqbase signed for error handling Dan Carpenter
@ 2013-11-18 10:40 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2013-11-18 10:40 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Grant Likely, Rob Herring, linux-gpio@vger.kernel.org,
	kernel-janitors

On Thu, Nov 7, 2013 at 8:50 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:

> There is a bug in mvebu_gpio_probe() where we do:
>
>         mvchip->irqbase = irq_alloc_descs(-1, 0, ngpios, -1);
>         if (mvchip->irqbase < 0) {
>
> The problem is that mvchip->irqbase is unsigned so the error handling
> doesn't work.  I have changed it to be a regular int.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied to fixes.

I'm tagging this for stable as well.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-18 10:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-07  7:50 [patch] gpio: mvebu: make mvchip->irqbase signed for error handling Dan Carpenter
2013-11-18 10:40 ` Linus Walleij

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).