aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar7/files
diff options
context:
space:
mode:
authorMatteo Croce <matteo@openwrt.org>2007-10-23 15:45:54 +0000
committerMatteo Croce <matteo@openwrt.org>2007-10-23 15:45:54 +0000
commite862674aa8cc63a3ed406ebf6a30f02e5dc9d4e8 (patch)
tree1c4e2b723ccc6c190f8e4d34b9bac60139f66029 /target/linux/ar7/files
parent198b1c3e4f865e6b4a63b4f5c38ce666cfbc8c79 (diff)
downloadupstream-e862674aa8cc63a3ed406ebf6a30f02e5dc9d4e8.tar.gz
upstream-e862674aa8cc63a3ed406ebf6a30f02e5dc9d4e8.tar.bz2
upstream-e862674aa8cc63a3ed406ebf6a30f02e5dc9d4e8.zip
ar7_gpio: remove unneeded checks and volatile
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9419 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar7/files')
-rw-r--r--target/linux/ar7/files/include/asm-mips/ar7/gpio.h16
1 files changed, 2 insertions, 14 deletions
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 a7ae1eeae1..2e19fcae9d 100644
--- a/target/linux/ar7/files/include/asm-mips/ar7/gpio.h
+++ b/target/linux/ar7/files/include/asm-mips/ar7/gpio.h
@@ -31,20 +31,14 @@ static inline int gpio_get_value(unsigned gpio)
void __iomem *gpio_in =
(void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_INPUT);
- if (gpio >= AR7_GPIO_MAX)
- return -EINVAL;
-
- return ((readl(gpio_in) & (1 << gpio)) != 0);
+ return readl(gpio_in) & (1 << gpio);
}
static inline void gpio_set_value(unsigned gpio, int value)
{
void __iomem *gpio_out =
(void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT);
- volatile unsigned tmp;
-
- if (gpio >= AR7_GPIO_MAX)
- return;
+ unsigned tmp;
tmp = readl(gpio_out) & ~(1 << gpio);
if (value)
@@ -95,9 +89,6 @@ static inline int ar7_gpio_enable(unsigned gpio)
void __iomem *gpio_en =
(void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE);
- if (gpio >= AR7_GPIO_MAX)
- return -EINVAL;
-
writel(readl(gpio_en) | (1 << gpio), gpio_en);
return 0;
@@ -108,9 +99,6 @@ static inline int ar7_gpio_disable(unsigned gpio)
void __iomem *gpio_en =
(void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE);
- if (gpio >= AR7_GPIO_MAX)
- return -EINVAL;
-
writel(readl(gpio_en) & ~(1 << gpio), gpio_en);
return 0;