When `CONFIG_DEBUG_FS` is disabled, nmk_gpio_dbg_show_one() is an empty dummy function; this however triggers a `-Wmissing-prototypes` warning and later a linker error because the function is also used by drivers/pinctrl/nomadik/pinctrl-nomadik.c, therefore it needs to be non-static. To allow both sources to access this dummy function, this patch moves it to the header, adding the `#ifdef CONFIG_DEBUG_FS` there as well.
Unified · Split
| @@ -486,14 +486,6 @@ static void nmk_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) · 485 unmodified lines | |||
| 486 | 486 | ||
| 487 | #else | 487 | #else |
| 488 | 488 | ||
| 489 | static inline void nmk_gpio_dbg_show_one(struct seq_file *s, | ||
| 490 | struct pinctrl_dev *pctldev, | ||
| 491 | struct gpio_chip *chip, | ||
| 492 | unsigned int offset, | ||
| 493 | unsigned int gpio) | ||
| 494 | { | ||
| 495 | } | ||
| 496 | |||
| 497 | #define nmk_gpio_dbg_show NULL | 489 | #define nmk_gpio_dbg_show NULL |
| 498 | 490 | ||
| 499 | #endif | 491 | #endif |
| @@ -253,6 +253,8 @@ nmk_pinctrl_db8540_init(const struct nmk_pinctrl_soc_data **soc) · 252 unmodified lines | |||
| 253 | 253 | ||
| 254 | struct platform_device; | 254 | struct platform_device; |
| 255 | 255 | ||
| 256 | #ifdef CONFIG_DEBUG_FS | ||
| 257 | |||
| 256 | /* | 258 | /* |
| 257 | * Symbols declared in gpio-nomadik used by pinctrl-nomadik. If pinctrl-nomadik | 259 | * Symbols declared in gpio-nomadik used by pinctrl-nomadik. If pinctrl-nomadik |
| 258 | * is enabled, then gpio-nomadik is enabled as well; the reverse if not always | 260 | * is enabled, then gpio-nomadik is enabled as well; the reverse if not always |
| @@ -261,6 +263,19 @@ struct platform_device; · 2 unmodified lines | |||
| 261 | void nmk_gpio_dbg_show_one(struct seq_file *s, struct pinctrl_dev *pctldev, | 263 | void nmk_gpio_dbg_show_one(struct seq_file *s, struct pinctrl_dev *pctldev, |
| 262 | struct gpio_chip *chip, unsigned int offset, | 264 | struct gpio_chip *chip, unsigned int offset, |
| 263 | unsigned int gpio); | 265 | unsigned int gpio); |
| 266 | |||
| 267 | #else | ||
| 268 | |||
| 269 | static inline void nmk_gpio_dbg_show_one(struct seq_file *s, | ||
| 270 | struct pinctrl_dev *pctldev, | ||
| 271 | struct gpio_chip *chip, | ||
| 272 | unsigned int offset, | ||
| 273 | unsigned int gpio) | ||
| 274 | { | ||
| 275 | } | ||
| 276 | |||
| 277 | #endif | ||
| 278 | |||
| 264 | void __nmk_gpio_make_output(struct nmk_gpio_chip *nmk_chip, | 279 | void __nmk_gpio_make_output(struct nmk_gpio_chip *nmk_chip, |
| 265 | unsigned int offset, int val); | 280 | unsigned int offset, int val); |
| 266 | void __nmk_gpio_set_slpm(struct nmk_gpio_chip *nmk_chip, unsigned int offset, | 281 | void __nmk_gpio_set_slpm(struct nmk_gpio_chip *nmk_chip, unsigned int offset, |