driver: pinctrl: fix unused variable warning
Subsystems (2)
PATCH 1/1 driver: pinctrl: fix unused variable warning
From: Lei Chen <[email protected]>
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 <[email protected]>
--- drivers/pinctrl/core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pinctrl/core.c +2 -0
@@ -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);
Signature · 1 line
1.8.3.1
Quoted 6 lines · On Fri, Dec 11, 2020 at 1:46 PM <[email protected]> wrote:
From: Lei Chen <[email protected]>
In
pinctrl_pins_show, range,gpio_numand chip variables are not used ifCONFIG_GPIOLIBis not defined. Use this macro to wrap them.
Rule of thumb: base your patches on the latest subsystem tree snapshot.
Signature · 2 lines
With Best Regards, Andy Shevchenko