s5j/gpio: clean up code
authorIvan <ivan.galkin@samsung.com>
Mon, 20 Mar 2017 11:07:07 +0000 (20:07 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Mon, 17 Apr 2017 10:52:06 +0000 (19:52 +0900)
Function open should not expose any GPIOs, so it is remained empty.

Function up_gpioinitialize should not expose any GPIO, remained empty.
This job will be done on board dependednt level by s5j_gpioinitialize()

Change-Id: I83649092e725b0750bea05dd285d52a938a58db2
Signed-off-by: Ivan <ivan.galkin@samsung.com>
os/arch/arm/src/s5j/s5j_gpio.c

index 3344a0f..bbb3dab 100644 (file)
@@ -227,8 +227,6 @@ static struct gpio_bank s5jt200_gpio_bank[] = {
 };
 #endif
 
-bool isinit = 0;
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
@@ -608,10 +606,6 @@ static const char *gpio_bank_name(int gpio)
  ****************************************************************************/
 static int s5j_gpio_open(FAR struct gpio_dev_s *dev)
 {
-       int idx = ((struct s5j_gpio_priv *)(dev->priv))->idx;
-       if (!isinit) {
-               up_create_gpio(idx);
-       }
        return OK;
 }
 
@@ -1764,7 +1758,8 @@ int up_create_gpio(int32_t idx)
  * Name: up_gpioinitialize 
  *
  * Description:
- *   Init all available GPIO, exposing them to file system: dev/gpioXX
+ *  Dummy function. Real function s5j_gpioinitialize, where GPIOs are exposed, 
+ *  called from board_init().
  *
  * Input Parameters:
  *   None
@@ -1775,12 +1770,7 @@ int up_create_gpio(int32_t idx)
  ****************************************************************************/
 void up_gpioinitialize(void)
 {
-       int i;
 
-       for (i = 0; i < NUM_GPIO; i++) {
-               up_create_gpio(i);
-       }
-       isinit = OK;
 }
 
 /****************************************************************************