提交 3567a4e2 编写于 作者: R Rafael J. Wysocki

platform / x86 / PM: Fix unused function warnings for CONFIG_PM_SLEEP

According to compiler warnings, quite some suspend/resume functions
in platform x86 drivers are not used for CONFIG_PM_SLEEP unset, so
add #ifdefs to prevent them from being built in that case.
Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
上级 90692404
...@@ -350,6 +350,7 @@ static void cmpc_accel_idev_init_v4(struct input_dev *inputdev) ...@@ -350,6 +350,7 @@ static void cmpc_accel_idev_init_v4(struct input_dev *inputdev)
inputdev->close = cmpc_accel_close_v4; inputdev->close = cmpc_accel_close_v4;
} }
#ifdef CONFIG_PM_SLEEP
static int cmpc_accel_suspend_v4(struct device *dev) static int cmpc_accel_suspend_v4(struct device *dev)
{ {
struct input_dev *inputdev; struct input_dev *inputdev;
...@@ -384,6 +385,7 @@ static int cmpc_accel_resume_v4(struct device *dev) ...@@ -384,6 +385,7 @@ static int cmpc_accel_resume_v4(struct device *dev)
return 0; return 0;
} }
#endif
static int cmpc_accel_add_v4(struct acpi_device *acpi) static int cmpc_accel_add_v4(struct acpi_device *acpi)
{ {
...@@ -752,6 +754,7 @@ static int cmpc_tablet_remove(struct acpi_device *acpi, int type) ...@@ -752,6 +754,7 @@ static int cmpc_tablet_remove(struct acpi_device *acpi, int type)
return cmpc_remove_acpi_notify_device(acpi); return cmpc_remove_acpi_notify_device(acpi);
} }
#ifdef CONFIG_PM_SLEEP
static int cmpc_tablet_resume(struct device *dev) static int cmpc_tablet_resume(struct device *dev)
{ {
struct input_dev *inputdev = dev_get_drvdata(dev); struct input_dev *inputdev = dev_get_drvdata(dev);
...@@ -761,6 +764,7 @@ static int cmpc_tablet_resume(struct device *dev) ...@@ -761,6 +764,7 @@ static int cmpc_tablet_resume(struct device *dev)
input_report_switch(inputdev, SW_TABLET_MODE, !val); input_report_switch(inputdev, SW_TABLET_MODE, !val);
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(cmpc_tablet_pm, NULL, cmpc_tablet_resume); static SIMPLE_DEV_PM_OPS(cmpc_tablet_pm, NULL, cmpc_tablet_resume);
......
...@@ -440,11 +440,13 @@ static int __devexit acpi_fujitsu_remove(struct acpi_device *adev, int type) ...@@ -440,11 +440,13 @@ static int __devexit acpi_fujitsu_remove(struct acpi_device *adev, int type)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int acpi_fujitsu_resume(struct device *dev) static int acpi_fujitsu_resume(struct device *dev)
{ {
fujitsu_reset(); fujitsu_reset();
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(acpi_fujitsu_pm, NULL, acpi_fujitsu_resume); static SIMPLE_DEV_PM_OPS(acpi_fujitsu_pm, NULL, acpi_fujitsu_resume);
......
...@@ -305,10 +305,12 @@ static int hdaps_probe(struct platform_device *dev) ...@@ -305,10 +305,12 @@ static int hdaps_probe(struct platform_device *dev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int hdaps_resume(struct device *dev) static int hdaps_resume(struct device *dev)
{ {
return hdaps_device_init(); return hdaps_device_init();
} }
#endif
static SIMPLE_DEV_PM_OPS(hdaps_pm, NULL, hdaps_resume); static SIMPLE_DEV_PM_OPS(hdaps_pm, NULL, hdaps_resume);
......
...@@ -352,7 +352,7 @@ static int lis3lv02d_remove(struct acpi_device *device, int type) ...@@ -352,7 +352,7 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int lis3lv02d_suspend(struct device *dev) static int lis3lv02d_suspend(struct device *dev)
{ {
/* make sure the device is off when we suspend */ /* make sure the device is off when we suspend */
......
...@@ -85,7 +85,9 @@ ...@@ -85,7 +85,9 @@
#define MSI_STANDARD_EC_TOUCHPAD_ADDRESS 0xe4 #define MSI_STANDARD_EC_TOUCHPAD_ADDRESS 0xe4
#define MSI_STANDARD_EC_TOUCHPAD_MASK (1 << 4) #define MSI_STANDARD_EC_TOUCHPAD_MASK (1 << 4)
#ifdef CONFIG_PM_SLEEP
static int msi_laptop_resume(struct device *device); static int msi_laptop_resume(struct device *device);
#endif
static SIMPLE_DEV_PM_OPS(msi_laptop_pm, NULL, msi_laptop_resume); static SIMPLE_DEV_PM_OPS(msi_laptop_pm, NULL, msi_laptop_resume);
#define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS 0x2f #define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS 0x2f
...@@ -753,6 +755,7 @@ static int rfkill_init(struct platform_device *sdev) ...@@ -753,6 +755,7 @@ static int rfkill_init(struct platform_device *sdev)
return retval; return retval;
} }
#ifdef CONFIG_PM_SLEEP
static int msi_laptop_resume(struct device *device) static int msi_laptop_resume(struct device *device)
{ {
u8 data; u8 data;
...@@ -773,6 +776,7 @@ static int msi_laptop_resume(struct device *device) ...@@ -773,6 +776,7 @@ static int msi_laptop_resume(struct device *device)
return 0; return 0;
} }
#endif
static int __init msi_laptop_input_setup(void) static int __init msi_laptop_input_setup(void)
{ {
......
...@@ -188,7 +188,9 @@ static const struct acpi_device_id pcc_device_ids[] = { ...@@ -188,7 +188,9 @@ static const struct acpi_device_id pcc_device_ids[] = {
}; };
MODULE_DEVICE_TABLE(acpi, pcc_device_ids); MODULE_DEVICE_TABLE(acpi, pcc_device_ids);
#ifdef CONFIG_PM_SLEEP
static int acpi_pcc_hotkey_resume(struct device *dev); static int acpi_pcc_hotkey_resume(struct device *dev);
#endif
static SIMPLE_DEV_PM_OPS(acpi_pcc_hotkey_pm, NULL, acpi_pcc_hotkey_resume); static SIMPLE_DEV_PM_OPS(acpi_pcc_hotkey_pm, NULL, acpi_pcc_hotkey_resume);
static struct acpi_driver acpi_pcc_driver = { static struct acpi_driver acpi_pcc_driver = {
...@@ -540,6 +542,7 @@ static void acpi_pcc_destroy_input(struct pcc_acpi *pcc) ...@@ -540,6 +542,7 @@ static void acpi_pcc_destroy_input(struct pcc_acpi *pcc)
/* kernel module interface */ /* kernel module interface */
#ifdef CONFIG_PM_SLEEP
static int acpi_pcc_hotkey_resume(struct device *dev) static int acpi_pcc_hotkey_resume(struct device *dev)
{ {
struct pcc_acpi *pcc; struct pcc_acpi *pcc;
...@@ -556,6 +559,7 @@ static int acpi_pcc_hotkey_resume(struct device *dev) ...@@ -556,6 +559,7 @@ static int acpi_pcc_hotkey_resume(struct device *dev)
return acpi_pcc_write_sset(pcc, SINF_STICKY_KEY, pcc->sticky_mode); return acpi_pcc_write_sset(pcc, SINF_STICKY_KEY, pcc->sticky_mode);
} }
#endif
static int acpi_pcc_hotkey_add(struct acpi_device *device) static int acpi_pcc_hotkey_add(struct acpi_device *device)
{ {
......
...@@ -140,7 +140,10 @@ MODULE_PARM_DESC(kbd_backlight_timeout, ...@@ -140,7 +140,10 @@ MODULE_PARM_DESC(kbd_backlight_timeout,
"1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout " "1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout "
"(default: 0)"); "(default: 0)");
#ifdef CONFIG_PM_SLEEP
static void sony_nc_kbd_backlight_resume(void); static void sony_nc_kbd_backlight_resume(void);
static void sony_nc_thermal_resume(void);
#endif
static int sony_nc_kbd_backlight_setup(struct platform_device *pd, static int sony_nc_kbd_backlight_setup(struct platform_device *pd,
unsigned int handle); unsigned int handle);
static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd); static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd);
...@@ -151,7 +154,6 @@ static void sony_nc_battery_care_cleanup(struct platform_device *pd); ...@@ -151,7 +154,6 @@ static void sony_nc_battery_care_cleanup(struct platform_device *pd);
static int sony_nc_thermal_setup(struct platform_device *pd); static int sony_nc_thermal_setup(struct platform_device *pd);
static void sony_nc_thermal_cleanup(struct platform_device *pd); static void sony_nc_thermal_cleanup(struct platform_device *pd);
static void sony_nc_thermal_resume(void);
static int sony_nc_lid_resume_setup(struct platform_device *pd); static int sony_nc_lid_resume_setup(struct platform_device *pd);
static void sony_nc_lid_resume_cleanup(struct platform_device *pd); static void sony_nc_lid_resume_cleanup(struct platform_device *pd);
...@@ -1431,6 +1433,7 @@ static void sony_nc_function_cleanup(struct platform_device *pd) ...@@ -1431,6 +1433,7 @@ static void sony_nc_function_cleanup(struct platform_device *pd)
sony_nc_handles_cleanup(pd); sony_nc_handles_cleanup(pd);
} }
#ifdef CONFIG_PM_SLEEP
static void sony_nc_function_resume(void) static void sony_nc_function_resume(void)
{ {
unsigned int i, result, bitmask, arg; unsigned int i, result, bitmask, arg;
...@@ -1508,6 +1511,7 @@ static int sony_nc_resume(struct device *dev) ...@@ -1508,6 +1511,7 @@ static int sony_nc_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(sony_nc_pm, NULL, sony_nc_resume); static SIMPLE_DEV_PM_OPS(sony_nc_pm, NULL, sony_nc_resume);
...@@ -1872,6 +1876,7 @@ static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd) ...@@ -1872,6 +1876,7 @@ static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd)
} }
} }
#ifdef CONFIG_PM_SLEEP
static void sony_nc_kbd_backlight_resume(void) static void sony_nc_kbd_backlight_resume(void)
{ {
int ignore = 0; int ignore = 0;
...@@ -1888,6 +1893,7 @@ static void sony_nc_kbd_backlight_resume(void) ...@@ -1888,6 +1893,7 @@ static void sony_nc_kbd_backlight_resume(void)
(kbdbl_ctl->base + 0x200) | (kbdbl_ctl->base + 0x200) |
(kbdbl_ctl->timeout << 0x10), &ignore); (kbdbl_ctl->timeout << 0x10), &ignore);
} }
#endif
struct battery_care_control { struct battery_care_control {
struct device_attribute attrs[2]; struct device_attribute attrs[2];
...@@ -2210,6 +2216,7 @@ static void sony_nc_thermal_cleanup(struct platform_device *pd) ...@@ -2210,6 +2216,7 @@ static void sony_nc_thermal_cleanup(struct platform_device *pd)
} }
} }
#ifdef CONFIG_PM_SLEEP
static void sony_nc_thermal_resume(void) static void sony_nc_thermal_resume(void)
{ {
unsigned int status = sony_nc_thermal_mode_get(); unsigned int status = sony_nc_thermal_mode_get();
...@@ -2217,6 +2224,7 @@ static void sony_nc_thermal_resume(void) ...@@ -2217,6 +2224,7 @@ static void sony_nc_thermal_resume(void)
if (status != th_handle->mode) if (status != th_handle->mode)
sony_nc_thermal_mode_set(th_handle->mode); sony_nc_thermal_mode_set(th_handle->mode);
} }
#endif
/* resume on LID open */ /* resume on LID open */
struct snc_lid_resume_control { struct snc_lid_resume_control {
...@@ -4287,6 +4295,7 @@ static int sony_pic_add(struct acpi_device *device) ...@@ -4287,6 +4295,7 @@ static int sony_pic_add(struct acpi_device *device)
return result; return result;
} }
#ifdef CONFIG_PM_SLEEP
static int sony_pic_suspend(struct device *dev) static int sony_pic_suspend(struct device *dev)
{ {
if (sony_pic_disable(to_acpi_device(dev))) if (sony_pic_disable(to_acpi_device(dev)))
...@@ -4300,6 +4309,7 @@ static int sony_pic_resume(struct device *dev) ...@@ -4300,6 +4309,7 @@ static int sony_pic_resume(struct device *dev)
spic_dev.cur_ioport, spic_dev.cur_irq); spic_dev.cur_ioport, spic_dev.cur_irq);
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(sony_pic_pm, sony_pic_suspend, sony_pic_resume); static SIMPLE_DEV_PM_OPS(sony_pic_pm, sony_pic_suspend, sony_pic_resume);
......
...@@ -922,6 +922,7 @@ static struct input_dev *tpacpi_inputdev; ...@@ -922,6 +922,7 @@ static struct input_dev *tpacpi_inputdev;
static struct mutex tpacpi_inputdev_send_mutex; static struct mutex tpacpi_inputdev_send_mutex;
static LIST_HEAD(tpacpi_all_drivers); static LIST_HEAD(tpacpi_all_drivers);
#ifdef CONFIG_PM_SLEEP
static int tpacpi_suspend_handler(struct device *dev) static int tpacpi_suspend_handler(struct device *dev)
{ {
struct ibm_struct *ibm, *itmp; struct ibm_struct *ibm, *itmp;
...@@ -949,6 +950,7 @@ static int tpacpi_resume_handler(struct device *dev) ...@@ -949,6 +950,7 @@ static int tpacpi_resume_handler(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(tpacpi_pm, static SIMPLE_DEV_PM_OPS(tpacpi_pm,
tpacpi_suspend_handler, tpacpi_resume_handler); tpacpi_suspend_handler, tpacpi_resume_handler);
......
...@@ -1296,6 +1296,7 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event) ...@@ -1296,6 +1296,7 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event)
} }
} }
#ifdef CONFIG_PM_SLEEP
static int toshiba_acpi_suspend(struct device *device) static int toshiba_acpi_suspend(struct device *device)
{ {
struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device)); struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device));
...@@ -1317,6 +1318,7 @@ static int toshiba_acpi_resume(struct device *device) ...@@ -1317,6 +1318,7 @@ static int toshiba_acpi_resume(struct device *device)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(toshiba_acpi_pm, static SIMPLE_DEV_PM_OPS(toshiba_acpi_pm,
toshiba_acpi_suspend, toshiba_acpi_resume); toshiba_acpi_suspend, toshiba_acpi_resume);
......
...@@ -41,7 +41,9 @@ static const struct acpi_device_id bt_device_ids[] = { ...@@ -41,7 +41,9 @@ static const struct acpi_device_id bt_device_ids[] = {
}; };
MODULE_DEVICE_TABLE(acpi, bt_device_ids); MODULE_DEVICE_TABLE(acpi, bt_device_ids);
#ifdef CONFIG_PM_SLEEP
static int toshiba_bt_resume(struct device *dev); static int toshiba_bt_resume(struct device *dev);
#endif
static SIMPLE_DEV_PM_OPS(toshiba_bt_pm, NULL, toshiba_bt_resume); static SIMPLE_DEV_PM_OPS(toshiba_bt_pm, NULL, toshiba_bt_resume);
static struct acpi_driver toshiba_bt_rfkill_driver = { static struct acpi_driver toshiba_bt_rfkill_driver = {
...@@ -90,10 +92,12 @@ static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event) ...@@ -90,10 +92,12 @@ static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event)
toshiba_bluetooth_enable(device->handle); toshiba_bluetooth_enable(device->handle);
} }
#ifdef CONFIG_PM_SLEEP
static int toshiba_bt_resume(struct device *dev) static int toshiba_bt_resume(struct device *dev)
{ {
return toshiba_bluetooth_enable(to_acpi_device(dev)->handle); return toshiba_bluetooth_enable(to_acpi_device(dev)->handle);
} }
#endif
static int toshiba_bt_rfkill_add(struct acpi_device *device) static int toshiba_bt_rfkill_add(struct acpi_device *device)
{ {
......
...@@ -77,10 +77,12 @@ static void ebook_switch_notify(struct acpi_device *device, u32 event) ...@@ -77,10 +77,12 @@ static void ebook_switch_notify(struct acpi_device *device, u32 event)
} }
} }
#ifdef CONFIG_PM_SLEEP
static int ebook_switch_resume(struct device *dev) static int ebook_switch_resume(struct device *dev)
{ {
return ebook_send_state(to_acpi_device(dev)); return ebook_send_state(to_acpi_device(dev));
} }
#endif
static SIMPLE_DEV_PM_OPS(ebook_switch_pm, NULL, ebook_switch_resume); static SIMPLE_DEV_PM_OPS(ebook_switch_pm, NULL, ebook_switch_resume);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册