]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/mips/au1000/common/gpio.c
[MIPS] Alchemy common code style cleanup
[linux-2.6-omap-h63xx.git] / arch / mips / au1000 / common / gpio.c
index 7abe420994390461ffb9d059475f6e5fb7defcce..b485d94ce8a5055d4e28b35f8dec1c7fc3b2af9e 100644 (file)
  *     others have a second one : GPIO2
  */
 
-#include <linux/autoconf.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/types.h>
 #include <linux/module.h>
 
-#include <asm/addrspace.h>
-
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/gpio.h>
 
@@ -75,7 +69,7 @@ static int au1xxx_gpio2_direction_output(unsigned gpio, int value)
 
 static int au1xxx_gpio1_read(unsigned gpio)
 {
-       return ((gpio1->pinstaterd >> gpio) & 0x01);
+       return (gpio1->pinstaterd >> gpio) & 0x01;
 }
 
 static void au1xxx_gpio1_write(unsigned gpio, int value)
@@ -110,7 +104,6 @@ int au1xxx_gpio_get_value(unsigned gpio)
        else
                return au1xxx_gpio1_read(gpio);
 }
-
 EXPORT_SYMBOL(au1xxx_gpio_get_value);
 
 void au1xxx_gpio_set_value(unsigned gpio, int value)
@@ -124,33 +117,30 @@ void au1xxx_gpio_set_value(unsigned gpio, int value)
        else
                au1xxx_gpio1_write(gpio, value);
 }
-
 EXPORT_SYMBOL(au1xxx_gpio_set_value);
 
 int au1xxx_gpio_direction_input(unsigned gpio)
 {
        if (gpio >= AU1XXX_GPIO_BASE)
 #if defined(CONFIG_SOC_AU1000)
-               ;
+               return -ENODEV;
 #else
                return au1xxx_gpio2_direction_input(gpio);
 #endif
-       else
-               return au1xxx_gpio1_direction_input(gpio);
-}
 
+       return au1xxx_gpio1_direction_input(gpio);
+}
 EXPORT_SYMBOL(au1xxx_gpio_direction_input);
 
 int au1xxx_gpio_direction_output(unsigned gpio, int value)
 {
        if (gpio >= AU1XXX_GPIO_BASE)
 #if defined(CONFIG_SOC_AU1000)
-               ;
+               return -ENODEV;
 #else
                return au1xxx_gpio2_direction_output(gpio, value);
 #endif
-       else
-               return au1xxx_gpio1_direction_output(gpio, value);
-}
 
+       return au1xxx_gpio1_direction_output(gpio, value);
+}
 EXPORT_SYMBOL(au1xxx_gpio_direction_output);