linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: remove duplicated function definition
@ 2019-07-31 10:00 YueHaibing
  2019-07-31 12:09 ` Yuehaibing
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2019-07-31 10:00 UTC (permalink / raw)
  To: linus.walleij, bgolaszewski, yamada.masahiro
  Cc: linux-kernel, linux-gpio, YueHaibing

when building without CONFIG_PINCTRL:

In file included from drivers/hwmon/pmbus/ucd9000.c:19:0:
./include/linux/gpio/driver.h:576:1: error: redefinition of gpiochip_add_pin_range
 gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
 ^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/hwmon/pmbus/ucd9000.c:18:0:
./include/linux/gpio.h:245:1: note: previous definition of gpiochip_add_pin_range was here
 gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
 ^~~~~~~~~~~~~~~~~~~~~~

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 964cb341882f ("gpio: move pincontrol calls to <linux/gpio/driver.h>")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 include/linux/gpio/driver.h | 35 +----------------------------------
 1 file changed, 1 insertion(+), 34 deletions(-)

diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index f28f534..09f96ec 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -10,6 +10,7 @@
 #include <linux/lockdep.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/pinctrl/pinconf-generic.h>
+#include <linux/gpio.h>
 
 struct gpio_desc;
 struct of_phandle_args;
@@ -560,40 +561,6 @@ struct gpio_pin_range {
 	struct pinctrl_gpio_range range;
 };
 
-#ifdef CONFIG_PINCTRL
-
-int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
-			   unsigned int gpio_offset, unsigned int pin_offset,
-			   unsigned int npins);
-int gpiochip_add_pingroup_range(struct gpio_chip *chip,
-			struct pinctrl_dev *pctldev,
-			unsigned int gpio_offset, const char *pin_group);
-void gpiochip_remove_pin_ranges(struct gpio_chip *chip);
-
-#else /* ! CONFIG_PINCTRL */
-
-static inline int
-gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
-		       unsigned int gpio_offset, unsigned int pin_offset,
-		       unsigned int npins)
-{
-	return 0;
-}
-static inline int
-gpiochip_add_pingroup_range(struct gpio_chip *chip,
-			struct pinctrl_dev *pctldev,
-			unsigned int gpio_offset, const char *pin_group)
-{
-	return 0;
-}
-
-static inline void
-gpiochip_remove_pin_ranges(struct gpio_chip *chip)
-{
-}
-
-#endif /* CONFIG_PINCTRL */
-
 struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *chip, u16 hwnum,
 					    const char *label,
 					    enum gpio_lookup_flags lflags,
-- 
2.7.4



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpio: remove duplicated function definition
  2019-07-31 10:00 [PATCH] gpio: remove duplicated function definition YueHaibing
@ 2019-07-31 12:09 ` Yuehaibing
  0 siblings, 0 replies; 2+ messages in thread
From: Yuehaibing @ 2019-07-31 12:09 UTC (permalink / raw)
  To: linus.walleij, bgolaszewski, yamada.masahiro; +Cc: linux-kernel, linux-gpio

Pls drop this

On 2019/7/31 18:00, YueHaibing wrote:
> when building without CONFIG_PINCTRL:
> 
> In file included from drivers/hwmon/pmbus/ucd9000.c:19:0:
> ./include/linux/gpio/driver.h:576:1: error: redefinition of gpiochip_add_pin_range
>  gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
>  ^~~~~~~~~~~~~~~~~~~~~~
> In file included from drivers/hwmon/pmbus/ucd9000.c:18:0:
> ./include/linux/gpio.h:245:1: note: previous definition of gpiochip_add_pin_range was here
>  gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
>  ^~~~~~~~~~~~~~~~~~~~~~
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: 964cb341882f ("gpio: move pincontrol calls to <linux/gpio/driver.h>")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  include/linux/gpio/driver.h | 35 +----------------------------------
>  1 file changed, 1 insertion(+), 34 deletions(-)
> 
> diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
> index f28f534..09f96ec 100644
> --- a/include/linux/gpio/driver.h
> +++ b/include/linux/gpio/driver.h
> @@ -10,6 +10,7 @@
>  #include <linux/lockdep.h>
>  #include <linux/pinctrl/pinctrl.h>
>  #include <linux/pinctrl/pinconf-generic.h>
> +#include <linux/gpio.h>
>  
>  struct gpio_desc;
>  struct of_phandle_args;
> @@ -560,40 +561,6 @@ struct gpio_pin_range {
>  	struct pinctrl_gpio_range range;
>  };
>  
> -#ifdef CONFIG_PINCTRL
> -
> -int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
> -			   unsigned int gpio_offset, unsigned int pin_offset,
> -			   unsigned int npins);
> -int gpiochip_add_pingroup_range(struct gpio_chip *chip,
> -			struct pinctrl_dev *pctldev,
> -			unsigned int gpio_offset, const char *pin_group);
> -void gpiochip_remove_pin_ranges(struct gpio_chip *chip);
> -
> -#else /* ! CONFIG_PINCTRL */
> -
> -static inline int
> -gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
> -		       unsigned int gpio_offset, unsigned int pin_offset,
> -		       unsigned int npins)
> -{
> -	return 0;
> -}
> -static inline int
> -gpiochip_add_pingroup_range(struct gpio_chip *chip,
> -			struct pinctrl_dev *pctldev,
> -			unsigned int gpio_offset, const char *pin_group)
> -{
> -	return 0;
> -}
> -
> -static inline void
> -gpiochip_remove_pin_ranges(struct gpio_chip *chip)
> -{
> -}
> -
> -#endif /* CONFIG_PINCTRL */
> -
>  struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *chip, u16 hwnum,
>  					    const char *label,
>  					    enum gpio_lookup_flags lflags,
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-31 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-31 10:00 [PATCH] gpio: remove duplicated function definition YueHaibing
2019-07-31 12:09 ` Yuehaibing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).