OSDN Git Service

kirkwood/orion: fix orion_gpio_set_blink
authorArnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
Wed, 18 Apr 2012 21:16:39 +0000 (23:16 +0200)
committerJason Cooper <jason@lakedaemon.net>
Tue, 15 May 2012 03:11:47 +0000 (03:11 +0000)
gpio registers are for 32 gpios. Given that orion_gpio_set_blink is called
directly and not through gpiolib, it needs to make sure that the pin value
given to the internal functions are between 0 and 31.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Tested-By: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
arch/arm/plat-orion/gpio.c

index 10d1608..d3401e7 100644 (file)
@@ -289,8 +289,8 @@ void orion_gpio_set_blink(unsigned pin, int blink)
                return;
 
        spin_lock_irqsave(&ochip->lock, flags);
-       __set_level(ochip, pin, 0);
-       __set_blinking(ochip, pin, blink);
+       __set_level(ochip, pin & 31, 0);
+       __set_blinking(ochip, pin & 31, blink);
        spin_unlock_irqrestore(&ochip->lock, flags);
 }
 EXPORT_SYMBOL(orion_gpio_set_blink);