Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: spear-keyboard - use __maybe_unused to hide pm functions

The spear keyboard driver uses #ifdef CONFIG_PM to hide its
power management functions, but then uses references from
SIMPLE_DEV_PM_OPS that are only present if both CONFIG_PM
and CONFIG_PM_SLEEP are set, resulting in a warning about unused
functions:

drivers/input/keyboard/spear-keyboard.c:292:12: error: 'spear_kbd_suspend' defined but not used [-Werror=unused-function]
drivers/input/keyboard/spear-keyboard.c:345:12: error: 'spear_kbd_resume' defined but not used [-Werror=unused-function]

This removes the #ifdef and instead uses a __maybe_unused
annotation.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Arnd Bergmann and committed by
Dmitry Torokhov
7ffae990 0581ce09

+2 -4
+2 -4
drivers/input/keyboard/spear-keyboard.c
··· 288 288 return 0; 289 289 } 290 290 291 - #ifdef CONFIG_PM 292 - static int spear_kbd_suspend(struct device *dev) 291 + static int __maybe_unused spear_kbd_suspend(struct device *dev) 293 292 { 294 293 struct platform_device *pdev = to_platform_device(dev); 295 294 struct spear_kbd *kbd = platform_get_drvdata(pdev); ··· 341 342 return 0; 342 343 } 343 344 344 - static int spear_kbd_resume(struct device *dev) 345 + static int __maybe_unused spear_kbd_resume(struct device *dev) 345 346 { 346 347 struct platform_device *pdev = to_platform_device(dev); 347 348 struct spear_kbd *kbd = platform_get_drvdata(pdev); ··· 367 368 368 369 return 0; 369 370 } 370 - #endif 371 371 372 372 static SIMPLE_DEV_PM_OPS(spear_kbd_pm_ops, spear_kbd_suspend, spear_kbd_resume); 373 373