Skip to contentSkip to conversation

gpio: mvebu: make mvchip->irqbase signed for error handling

PATCH Applied Dan Carpenter 2 participants 2 messages Nov 7, 2013 – Nov 18, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: mvebu: make mvchip->irqbase signed for error handling

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.

drivers/gpio/gpio-mvebu.c +1 -1
index 3c3321f..db31290 100644
@@ -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;
 };
#1 lore raw
Quoted 9 lines · Dan Carpenter

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.

Applied to fixes.

I'm tagging this for stable as well.

Yours,
Linus Walleij