Skip to contentSkip to conversation

Fix compiler error when build common/cmd_gpio.c for mpc85xx (p1020) when CONFIG_CMD_GPIO is defined

PATCH New Oleksandr G Zhadan 1 participant 1 message Mar 27, 2015 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compiler error when build common/cmd_gpio.c for mpc85xx (p1020) when CONFIG_CMD_GPIO is defined

From 33dc654a90fd648d070513d640b161fcd3eda9bd Mon Sep 17 00:00:00 2001
From: Oleksandr Zhadan <[email protected]>
Date: Fri, 27 Mar 2015 16:59:11 -0400

Fix compiler error when build common/cmd_gpio.c for mpc85xx (p1020) when CONFIG_CMD_GPIO is defined and incompatibility in functions gpio_free() and gpio_set_value() definitions between <asm/gpio.h> and <asm-generic/gpio.h>

---

  arch/powerpc/include/asm/arch-mpc85xx/gpio.h |    2 ++
  arch/powerpc/include/asm/mpc85xx_gpio.h      |    6 ++++--
  2 files changed, 6 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/arch/powerpc/include/asm/arch-mpc85xx/gpio.h
index 8beed30..71794a8 100644

arch/powerpc/include/asm/arch-mpc85xx/gpio.h +2 -0
@@ -12,4 +12,6 @@
  #ifndef __ASM_ARCH_MX85XX_GPIO_H
  #define __ASM_ARCH_MX85XX_GPIO_H
 
+#include <asm/mpc85xx_gpio.h>
+
  #endif
(quoted diff) +0 -0

b/arch/powerpc/include/asm/mpc85xx_gpio.h
index 87bb4a0..1d0dad4 100644

arch/powerpc/include/asm/mpc85xx_gpio.h +0 -0
@@ -72,9 +72,10 @@ static inline int gpio_request(unsigned gpio, const 

char *label)

         return 0;

}

-static inline void gpio_free(unsigned gpio)
+static inline int gpio_free(unsigned gpio)

  {
         /* Compatibility shim */

+ return 0;
}

static inline int gpio_direction_input(unsigned gpio)
@@ -97,12 +98,13 @@ static inline int gpio_get_value(unsigned gpio)

         return !!mpc85xx_gpio_get(1U << gpio);

}

-static inline void gpio_set_value(unsigned gpio, int value) +static inline int gpio_set_value(unsigned gpio, int value)

  {
         if (value)
                 mpc85xx_gpio_set_high(1U << gpio);
         else
                 mpc85xx_gpio_set_low(1U << gpio);

+ return 0;
}

static inline int gpio_is_valid(int gpio)

Signature · 1 line
1.6.4.2