ar7_gpio: remove unneeded checks and volatile

SVN-Revision: 9419
This commit is contained in:
Matteo Croce 2007-10-23 15:45:54 +00:00
parent 71f9b205e4
commit 788a010131
1 changed files with 2 additions and 14 deletions

View File

@ -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;