platform/x86: surface3-wmi: Shut up unused-function warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 10 Jan 2017 15:28:47 +0000 (16:28 +0100)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 20 Jan 2017 23:43:42 +0000 (01:43 +0200)
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: 3dda3b3798f9 ("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>
drivers/platform/x86/surface3-wmi.c

index cbf4d83a727106ee0f7e42ca1b868616d994c0c3..6ac1d1349d7e29b2104db726be60565b5079f0a0 100644 (file)
@@ -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 = {