Skip to content

Commit

Permalink
platform/x86: surface3-wmi: Shut up unused-function warning
Browse files Browse the repository at this point in the history
The newly added driver guards its "resume" callback with an
warning in some configurations:

drivers/platform/x86/surface3-wmi.c:248:12: error: 's3_wmi_resume' defined but not used [-Werror=unused-function]

Using a __maybe_unused annotation without an #ifdef avoids the mistake more
reliably.

Fixes: 3dda3b3 ("platform/x86: Add custom surface3 platform device for controlling LID")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
  • Loading branch information
Arnd Bergmann authored and Andy Shevchenko committed Jan 20, 2017
1 parent 63d762b commit 44e6861
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/platform/x86/surface3-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,11 @@ static int s3_wmi_remove(struct platform_device *device)
return 0;
}

#ifdef CONFIG_PM
static int s3_wmi_resume(struct device *dev)
static int __maybe_unused s3_wmi_resume(struct device *dev)
{
s3_wmi_send_lid_state();
return 0;
}
#endif
static SIMPLE_DEV_PM_OPS(s3_wmi_pm, NULL, s3_wmi_resume);

static struct platform_driver s3_wmi_driver = {
Expand Down

0 comments on commit 44e6861

Please sign in to comment.