All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] driver: pinctrl: fix unused variable warning
@ 2020-12-11  4:06 chenlei0x
  2020-12-11 18:58 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: chenlei0x @ 2020-12-11  4:06 UTC (permalink / raw)
  To: chenlei0x, linus.walleij, linux-gpio, linux-kernel; +Cc: Lei Chen

From: Lei Chen <lennychen@tencent.com>

In pinctrl_pins_show, range, gpio_num and chip variables are not used if
CONFIG_GPIOLIB is not defined. Use this macro to wrap them.

Signed-off-by: Lei Chen <lennychen@tencent.com>
---
 drivers/pinctrl/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 3663d87..9fc4433 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1602,9 +1602,11 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
 	struct pinctrl_dev *pctldev = s->private;
 	const struct pinctrl_ops *ops = pctldev->desc->pctlops;
 	unsigned i, pin;
+#ifdef CONFIG_GPIOLIB
 	struct pinctrl_gpio_range *range;
 	unsigned int gpio_num;
 	struct gpio_chip *chip;
+#endif
 
 	seq_printf(s, "registered pins: %d\n", pctldev->desc->npins);
 
-- 
1.8.3.1


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

* Re: [PATCH] driver: pinctrl: fix unused variable warning
  2020-12-11  4:06 [PATCH] driver: pinctrl: fix unused variable warning chenlei0x
@ 2020-12-11 18:58 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2020-12-11 18:58 UTC (permalink / raw)
  To: chenlei0x
  Cc: Linus Walleij, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, Lei Chen

On Fri, Dec 11, 2020 at 1:46 PM <chenlei0x@gmail.com> wrote:
>
> From: Lei Chen <lennychen@tencent.com>
>
> In pinctrl_pins_show, range, gpio_num and chip variables are not used if
> CONFIG_GPIOLIB is not defined. Use this macro to wrap them.
>

https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/commit/drivers/pinctrl/core.c?h=for-next&id=b507cb92477ad85902783a183c5ce01d16296687

Rule of thumb: base your patches on the latest subsystem tree snapshot.

-- 
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2020-12-11 20:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11  4:06 [PATCH] driver: pinctrl: fix unused variable warning chenlei0x
2020-12-11 18:58 ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.