From: Matteo Croce Date: Sat, 12 Jan 2008 17:14:15 +0000 (+0000) Subject: GPIO fix X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5d249c898d05ad60ae6e9212c54b426a19d9acc0;p=openwrt%2Fstaging%2Frmilecki.git GPIO fix SVN-Revision: 10180 --- diff --git a/target/linux/ar7/files/include/asm-mips/ar7/gpio.h b/target/linux/ar7/files/include/asm-mips/ar7/gpio.h index 7d665ff62dd..00418b58634 100644 --- a/target/linux/ar7/files/include/asm-mips/ar7/gpio.h +++ b/target/linux/ar7/files/include/asm-mips/ar7/gpio.h @@ -41,15 +41,14 @@ static inline int gpio_get_value(unsigned gpio) static inline void gpio_set_value(unsigned gpio, int value) { - static unsigned addr; + static void __iomem *gpio_out; unsigned tmp; - void __iomem *gpio_out = - (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT); - if (!addr) - addr = readl(gpio_out); + if (!gpio_out) + gpio_out = (void __iomem *) + KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT); - tmp = addr & ~(1 << gpio); + tmp = readl(gpio_out) & ~(1 << gpio); if (value) tmp |= 1 << gpio; writel(tmp, gpio_out);