diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-05-03 11:26:53 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-05-09 05:58:57 -0400 |
commit | caee57ec71e1a0cb50b6028c706cfe541dcb080a (patch) | |
tree | a6d2e273ac2e4384591319a073da25a72dba724d | |
parent | 9d814d410ddc61426a852b45ad514f3b924b9164 (diff) |
pinctrl: nomadik: hide nmk_gpio_get_mode when unused
nmk_gpio_get_mode is only used in one place, and that is conditionally
compiled if DEBUG_FS is enabled. A recent cleanup has marked the
definition 'static', which now leads to a warning:
drivers/pinctrl/nomadik/pinctrl-nomadik.c:614:12: error: 'nmk_gpio_get_mode' defined but not used [-Werror=unused-function]
static int nmk_gpio_get_mode(struct nmk_gpio_chip *nmk_chip, int offset)
^~~~~~~~~~~~~~~~~
Moving the function itself inside the #ifdef shuts it up again.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 5e81e0a0913c ("pinctrl: nomadik: use BIT() with offsets consequently")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/nomadik/pinctrl-nomadik.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index f85ae2efbb28..f3b5c395285b 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c | |||
@@ -611,20 +611,6 @@ static int __maybe_unused nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, | |||
611 | return NMK_GPIO_ALT_C; | 611 | return NMK_GPIO_ALT_C; |
612 | } | 612 | } |
613 | 613 | ||
614 | static int nmk_gpio_get_mode(struct nmk_gpio_chip *nmk_chip, int offset) | ||
615 | { | ||
616 | u32 afunc, bfunc; | ||
617 | |||
618 | clk_enable(nmk_chip->clk); | ||
619 | |||
620 | afunc = readl(nmk_chip->addr + NMK_GPIO_AFSLA) & BIT(offset); | ||
621 | bfunc = readl(nmk_chip->addr + NMK_GPIO_AFSLB) & BIT(offset); | ||
622 | |||
623 | clk_disable(nmk_chip->clk); | ||
624 | |||
625 | return (afunc ? NMK_GPIO_ALT_A : 0) | (bfunc ? NMK_GPIO_ALT_B : 0); | ||
626 | } | ||
627 | |||
628 | /* IRQ functions */ | 614 | /* IRQ functions */ |
629 | 615 | ||
630 | static void nmk_gpio_irq_ack(struct irq_data *d) | 616 | static void nmk_gpio_irq_ack(struct irq_data *d) |
@@ -929,6 +915,19 @@ static int nmk_gpio_make_output(struct gpio_chip *chip, unsigned offset, | |||
929 | } | 915 | } |
930 | 916 | ||
931 | #ifdef CONFIG_DEBUG_FS | 917 | #ifdef CONFIG_DEBUG_FS |
918 | static int nmk_gpio_get_mode(struct nmk_gpio_chip *nmk_chip, int offset) | ||
919 | { | ||
920 | u32 afunc, bfunc; | ||
921 | |||
922 | clk_enable(nmk_chip->clk); | ||
923 | |||
924 | afunc = readl(nmk_chip->addr + NMK_GPIO_AFSLA) & BIT(offset); | ||
925 | bfunc = readl(nmk_chip->addr + NMK_GPIO_AFSLB) & BIT(offset); | ||
926 | |||
927 | clk_disable(nmk_chip->clk); | ||
928 | |||
929 | return (afunc ? NMK_GPIO_ALT_A : 0) | (bfunc ? NMK_GPIO_ALT_B : 0); | ||
930 | } | ||
932 | 931 | ||
933 | #include <linux/seq_file.h> | 932 | #include <linux/seq_file.h> |
934 | 933 | ||