Skip to content

Commit

Permalink
Input: spear-keyboard - use __maybe_unused to hide pm functions
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
arndb authored and dtor committed Mar 2, 2016
1 parent 0581ce0 commit 7ffae99
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/input/keyboard/spear-keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ static int spear_kbd_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM
static int spear_kbd_suspend(struct device *dev)
static int __maybe_unused spear_kbd_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct spear_kbd *kbd = platform_get_drvdata(pdev);
Expand Down Expand Up @@ -342,7 +341,7 @@ static int spear_kbd_suspend(struct device *dev)
return 0;
}

static int spear_kbd_resume(struct device *dev)
static int __maybe_unused spear_kbd_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct spear_kbd *kbd = platform_get_drvdata(pdev);
Expand All @@ -368,7 +367,6 @@ static int spear_kbd_resume(struct device *dev)

return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(spear_kbd_pm_ops, spear_kbd_suspend, spear_kbd_resume);

Expand Down

0 comments on commit 7ffae99

Please sign in to comment.