diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-01-17 09:03:22 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-01-22 04:23:34 -0500 |
commit | d59b4eaaf04db07a02f092bfcb00de7f2e2d10db (patch) | |
tree | 793bf9fadb38ebcbbe84d6e403405c3e43e81023 /include | |
parent | c111feabe2e200b15300d97107ffc1280bf8de2a (diff) |
gpio: fix warning of 'struct gpio_chip' declaration
The struct gpio_chip is only defined inside #ifdef CONFIG_GPIOLIB,
but it's referenced by gpiochip_add_pin_range() and
gpiochip_remove_pin_ranges() which are outside #ifdef CONFIG_GPIOLIB.
Thus, we see the following warning when building blackfin image, where
GPIOLIB is not required.
CC arch/blackfin/kernel/bfin_gpio.o
CC init/version.o
In file included from arch/blackfin/include/asm/gpio.h:321,
from arch/blackfin/kernel/bfin_gpio.c:15:
include/asm-generic/gpio.h:298: warning: 'struct gpio_chip' declared inside parameter list
include/asm-generic/gpio.h:298: warning: its scope is only this definition or declaration, which is probably not what you want
include/asm-generic/gpio.h:304: warning: 'struct gpio_chip' declared inside parameter list
Move pinctrl trunk into #ifdef CONFIG_GPIOLIB to fix the warning,
since it appears that pinctrl gpio range support depends on GPIOLIB.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/gpio.h | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 20ca7663975f..23410147555f 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -212,6 +212,43 @@ extern void gpio_unexport(unsigned gpio); | |||
212 | 212 | ||
213 | #endif /* CONFIG_GPIO_SYSFS */ | 213 | #endif /* CONFIG_GPIO_SYSFS */ |
214 | 214 | ||
215 | #ifdef CONFIG_PINCTRL | ||
216 | |||
217 | /** | ||
218 | * struct gpio_pin_range - pin range controlled by a gpio chip | ||
219 | * @head: list for maintaining set of pin ranges, used internally | ||
220 | * @pctldev: pinctrl device which handles corresponding pins | ||
221 | * @range: actual range of pins controlled by a gpio controller | ||
222 | */ | ||
223 | |||
224 | struct gpio_pin_range { | ||
225 | struct list_head node; | ||
226 | struct pinctrl_dev *pctldev; | ||
227 | struct pinctrl_gpio_range range; | ||
228 | }; | ||
229 | |||
230 | int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
231 | unsigned int gpio_offset, unsigned int pin_offset, | ||
232 | unsigned int npins); | ||
233 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | ||
234 | |||
235 | #else | ||
236 | |||
237 | static inline int | ||
238 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
239 | unsigned int gpio_offset, unsigned int pin_offset, | ||
240 | unsigned int npins) | ||
241 | { | ||
242 | return 0; | ||
243 | } | ||
244 | |||
245 | static inline void | ||
246 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | ||
247 | { | ||
248 | } | ||
249 | |||
250 | #endif /* CONFIG_PINCTRL */ | ||
251 | |||
215 | #else /* !CONFIG_GPIOLIB */ | 252 | #else /* !CONFIG_GPIOLIB */ |
216 | 253 | ||
217 | static inline bool gpio_is_valid(int number) | 254 | static inline bool gpio_is_valid(int number) |
@@ -270,41 +307,4 @@ static inline void gpio_unexport(unsigned gpio) | |||
270 | } | 307 | } |
271 | #endif /* CONFIG_GPIO_SYSFS */ | 308 | #endif /* CONFIG_GPIO_SYSFS */ |
272 | 309 | ||
273 | #ifdef CONFIG_PINCTRL | ||
274 | |||
275 | /** | ||
276 | * struct gpio_pin_range - pin range controlled by a gpio chip | ||
277 | * @head: list for maintaining set of pin ranges, used internally | ||
278 | * @pctldev: pinctrl device which handles corresponding pins | ||
279 | * @range: actual range of pins controlled by a gpio controller | ||
280 | */ | ||
281 | |||
282 | struct gpio_pin_range { | ||
283 | struct list_head node; | ||
284 | struct pinctrl_dev *pctldev; | ||
285 | struct pinctrl_gpio_range range; | ||
286 | }; | ||
287 | |||
288 | int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
289 | unsigned int gpio_offset, unsigned int pin_offset, | ||
290 | unsigned int npins); | ||
291 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | ||
292 | |||
293 | #else | ||
294 | |||
295 | static inline int | ||
296 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
297 | unsigned int gpio_offset, unsigned int pin_offset, | ||
298 | unsigned int npins) | ||
299 | { | ||
300 | return 0; | ||
301 | } | ||
302 | |||
303 | static inline void | ||
304 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | ||
305 | { | ||
306 | } | ||
307 | |||
308 | #endif /* CONFIG_PINCTRL */ | ||
309 | |||
310 | #endif /* _ASM_GENERIC_GPIO_H */ | 310 | #endif /* _ASM_GENERIC_GPIO_H */ |