Message ID | 1607659581-15764-1-git-send-email-lennychen@tencent.com |
---|---|
State | New |
Headers | show |
Series | driver: pinctrl: fix unused variable warning | expand |
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.
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);