Skip to content

Commit 5626af8

Browse files
arndblinusw
authored andcommitted
pinctrl: sp7021: fix unused function warning
sppctl_gpio_inv_get is only used from the debugfs code inside of an #ifdef, so we get a warning without that: drivers/pinctrl/sunplus/sppctl.c:393:12: error: 'sppctl_gpio_inv_get' defined but not used [-Werror=unused-function] 393 | static int sppctl_gpio_inv_get(struct gpio_chip *chip, unsigned int offset) | ^~~~~~~~~~~~~~~~~~~ Replace the #ifdef with an IS_ENABLED() check that avoids the warning. Fixes: aa74c44 ("pinctrl: Add driver for Sunplus SP7021") Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 1b929c0 commit 5626af8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/pinctrl/sunplus/sppctl.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,6 @@ static int sppctl_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
499499
return 0;
500500
}
501501

502-
#ifdef CONFIG_DEBUG_FS
503502
static void sppctl_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
504503
{
505504
const char *label;
@@ -521,7 +520,6 @@ static void sppctl_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
521520
seq_puts(s, "\n");
522521
}
523522
}
524-
#endif
525523

526524
static int sppctl_gpio_new(struct platform_device *pdev, struct sppctl_pdata *pctl)
527525
{
@@ -550,9 +548,8 @@ static int sppctl_gpio_new(struct platform_device *pdev, struct sppctl_pdata *pc
550548
gchip->get = sppctl_gpio_get;
551549
gchip->set = sppctl_gpio_set;
552550
gchip->set_config = sppctl_gpio_set_config;
553-
#ifdef CONFIG_DEBUG_FS
554-
gchip->dbg_show = sppctl_gpio_dbg_show;
555-
#endif
551+
gchip->dbg_show = IS_ENABLED(CONFIG_DEBUG_FS) ?
552+
sppctl_gpio_dbg_show : NULL;
556553
gchip->base = -1;
557554
gchip->ngpio = sppctl_gpio_list_sz;
558555
gchip->names = sppctl_gpio_list_s;

0 commit comments

Comments
 (0)