powerpc/mpc85xx: Fix compiling error with DM_GPIO
authorMadalin Bucur <madalin.bucur@oss.nxp.com>
Wed, 29 Apr 2020 05:33:33 +0000 (08:33 +0300)
committerPriyanka Jain <priyanka.jain@nxp.com>
Wed, 3 Jun 2020 06:44:27 +0000 (12:14 +0530)
P4080DS compilation fails with DM_GPIO enabled:

drivers/gpio/gpio-uclass.c:355:5: error: redefinition of 'gpio_request'
 int gpio_request(unsigned gpio, const char *label)
     ^~~~~~~~~~~~
In file included from ./arch/powerpc/include/asm/arch/gpio.h:17:0,
                 from ./arch/powerpc/include/asm/gpio.h:1,
                 from drivers/gpio/gpio-uclass.c:16:
./arch/powerpc/include/asm/mpc85xx_gpio.h:68:19: note: previous definition of 'gpio_request' was here
 static inline int gpio_request(unsigned gpio, const char *label)
                   ^~~~~~~~~~~~

Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
arch/powerpc/include/asm/mpc85xx_gpio.h

index 1b332f0b193000c32097f07d861ee1f2c16976da..feebe15caca84810c205166685b650b37f837e59 100644 (file)
@@ -6,6 +6,7 @@
 #ifndef POWERPC_ASM_MPC85XX_GPIO_H_
 #define POWERPC_ASM_MPC85XX_GPIO_H_
 
+#ifndef CONFIG_DM_GPIO
 # include <asm/immap_85xx.h>
 
 /*
@@ -110,5 +111,5 @@ static inline int gpio_is_valid(int gpio)
 {
        return (gpio >= 0) && (gpio < 32);
 }
-
+#endif /* not CONFIG_DM_GPIO */
 #endif /* not POWERPC_ASM_MPC85XX_GPIO_H_ */