diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-02-17 10:13:44 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-03-06 08:35:22 -0500 |
commit | b115bebc07f282067eccc06fd5aa3060ab1426da (patch) | |
tree | dd1dcda1c95909a8035992b560dda8592c7a80fe | |
parent | fa6256db033067b57318decdc1c583512a1f8f68 (diff) |
gpio: xgene: mark PM functions as __maybe_unused
When CONFIG_PM_SLEEP is disabled, we get a warning about unused functions:
drivers/gpio/gpio-xgene.c:155:12: warning: 'xgene_gpio_resume' defined but not used [-Wunused-function]
static int xgene_gpio_resume(struct device *dev)
^~~~~~~~~~~~~~~~~
drivers/gpio/gpio-xgene.c:142:12: warning: 'xgene_gpio_suspend' defined but not used [-Wunused-function]
static int xgene_gpio_suspend(struct device *dev)
The warnings are harmless and can be avoided by simplifying the code and marking
the functions as __maybe_unused.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/gpio/gpio-xgene.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c index 40a8881c2ce8..f1c6ec17b90a 100644 --- a/drivers/gpio/gpio-xgene.c +++ b/drivers/gpio/gpio-xgene.c | |||
@@ -42,9 +42,7 @@ struct xgene_gpio { | |||
42 | struct gpio_chip chip; | 42 | struct gpio_chip chip; |
43 | void __iomem *base; | 43 | void __iomem *base; |
44 | spinlock_t lock; | 44 | spinlock_t lock; |
45 | #ifdef CONFIG_PM | ||
46 | u32 set_dr_val[XGENE_MAX_GPIO_BANKS]; | 45 | u32 set_dr_val[XGENE_MAX_GPIO_BANKS]; |
47 | #endif | ||
48 | }; | 46 | }; |
49 | 47 | ||
50 | static int xgene_gpio_get(struct gpio_chip *gc, unsigned int offset) | 48 | static int xgene_gpio_get(struct gpio_chip *gc, unsigned int offset) |
@@ -138,8 +136,7 @@ static int xgene_gpio_dir_out(struct gpio_chip *gc, | |||
138 | return 0; | 136 | return 0; |
139 | } | 137 | } |
140 | 138 | ||
141 | #ifdef CONFIG_PM | 139 | static __maybe_unused int xgene_gpio_suspend(struct device *dev) |
142 | static int xgene_gpio_suspend(struct device *dev) | ||
143 | { | 140 | { |
144 | struct xgene_gpio *gpio = dev_get_drvdata(dev); | 141 | struct xgene_gpio *gpio = dev_get_drvdata(dev); |
145 | unsigned long bank_offset; | 142 | unsigned long bank_offset; |
@@ -152,7 +149,7 @@ static int xgene_gpio_suspend(struct device *dev) | |||
152 | return 0; | 149 | return 0; |
153 | } | 150 | } |
154 | 151 | ||
155 | static int xgene_gpio_resume(struct device *dev) | 152 | static __maybe_unused int xgene_gpio_resume(struct device *dev) |
156 | { | 153 | { |
157 | struct xgene_gpio *gpio = dev_get_drvdata(dev); | 154 | struct xgene_gpio *gpio = dev_get_drvdata(dev); |
158 | unsigned long bank_offset; | 155 | unsigned long bank_offset; |
@@ -166,10 +163,6 @@ static int xgene_gpio_resume(struct device *dev) | |||
166 | } | 163 | } |
167 | 164 | ||
168 | static SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume); | 165 | static SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume); |
169 | #define XGENE_GPIO_PM_OPS (&xgene_gpio_pm) | ||
170 | #else | ||
171 | #define XGENE_GPIO_PM_OPS NULL | ||
172 | #endif | ||
173 | 166 | ||
174 | static int xgene_gpio_probe(struct platform_device *pdev) | 167 | static int xgene_gpio_probe(struct platform_device *pdev) |
175 | { | 168 | { |
@@ -241,7 +234,7 @@ static struct platform_driver xgene_gpio_driver = { | |||
241 | .name = "xgene-gpio", | 234 | .name = "xgene-gpio", |
242 | .of_match_table = xgene_gpio_of_match, | 235 | .of_match_table = xgene_gpio_of_match, |
243 | .acpi_match_table = ACPI_PTR(xgene_gpio_acpi_match), | 236 | .acpi_match_table = ACPI_PTR(xgene_gpio_acpi_match), |
244 | .pm = XGENE_GPIO_PM_OPS, | 237 | .pm = &xgene_gpio_pm, |
245 | }, | 238 | }, |
246 | .probe = xgene_gpio_probe, | 239 | .probe = xgene_gpio_probe, |
247 | }; | 240 | }; |