diff mbox series

driver: pinctrl: fix unused variable warning

Message ID 1607659581-15764-1-git-send-email-lennychen@tencent.com
State New
Headers show
Series driver: pinctrl: fix unused variable warning | expand

Commit Message

chenlei0x@gmail.com Dec. 11, 2020, 4:06 a.m. UTC
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(+)

Comments

Andy Shevchenko Dec. 11, 2020, 6:58 p.m. UTC | #1
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 mbox series

Patch

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);