diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-08-09 17:00:13 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-08-10 08:29:43 -0400 |
commit | 3567a4e2c52ce2f6fe74fc85690335ec7c96608e (patch) | |
tree | 2400504d924d59932000d6f25ded5b04cb1e1bbf /drivers/platform/x86/sony-laptop.c | |
parent | 9069240480e24a2d6ce23404c9ad6cabf59b7258 (diff) |
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: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/platform/x86/sony-laptop.c')
-rw-r--r-- | drivers/platform/x86/sony-laptop.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 9363969ad07a..daaddec68def 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
@@ -140,7 +140,10 @@ MODULE_PARM_DESC(kbd_backlight_timeout, | |||
140 | "1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout " | 140 | "1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout " |
141 | "(default: 0)"); | 141 | "(default: 0)"); |
142 | 142 | ||
143 | #ifdef CONFIG_PM_SLEEP | ||
143 | static void sony_nc_kbd_backlight_resume(void); | 144 | static void sony_nc_kbd_backlight_resume(void); |
145 | static void sony_nc_thermal_resume(void); | ||
146 | #endif | ||
144 | static int sony_nc_kbd_backlight_setup(struct platform_device *pd, | 147 | static int sony_nc_kbd_backlight_setup(struct platform_device *pd, |
145 | unsigned int handle); | 148 | unsigned int handle); |
146 | static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd); | 149 | 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 | 154 | ||
152 | static int sony_nc_thermal_setup(struct platform_device *pd); | 155 | static int sony_nc_thermal_setup(struct platform_device *pd); |
153 | static void sony_nc_thermal_cleanup(struct platform_device *pd); | 156 | static void sony_nc_thermal_cleanup(struct platform_device *pd); |
154 | static void sony_nc_thermal_resume(void); | ||
155 | 157 | ||
156 | static int sony_nc_lid_resume_setup(struct platform_device *pd); | 158 | static int sony_nc_lid_resume_setup(struct platform_device *pd); |
157 | static void sony_nc_lid_resume_cleanup(struct platform_device *pd); | 159 | 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 | sony_nc_handles_cleanup(pd); | 1433 | sony_nc_handles_cleanup(pd); |
1432 | } | 1434 | } |
1433 | 1435 | ||
1436 | #ifdef CONFIG_PM_SLEEP | ||
1434 | static void sony_nc_function_resume(void) | 1437 | static void sony_nc_function_resume(void) |
1435 | { | 1438 | { |
1436 | unsigned int i, result, bitmask, arg; | 1439 | unsigned int i, result, bitmask, arg; |
@@ -1508,6 +1511,7 @@ static int sony_nc_resume(struct device *dev) | |||
1508 | 1511 | ||
1509 | return 0; | 1512 | return 0; |
1510 | } | 1513 | } |
1514 | #endif | ||
1511 | 1515 | ||
1512 | static SIMPLE_DEV_PM_OPS(sony_nc_pm, NULL, sony_nc_resume); | 1516 | static SIMPLE_DEV_PM_OPS(sony_nc_pm, NULL, sony_nc_resume); |
1513 | 1517 | ||
@@ -1872,6 +1876,7 @@ static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd) | |||
1872 | } | 1876 | } |
1873 | } | 1877 | } |
1874 | 1878 | ||
1879 | #ifdef CONFIG_PM_SLEEP | ||
1875 | static void sony_nc_kbd_backlight_resume(void) | 1880 | static void sony_nc_kbd_backlight_resume(void) |
1876 | { | 1881 | { |
1877 | int ignore = 0; | 1882 | int ignore = 0; |
@@ -1888,6 +1893,7 @@ static void sony_nc_kbd_backlight_resume(void) | |||
1888 | (kbdbl_ctl->base + 0x200) | | 1893 | (kbdbl_ctl->base + 0x200) | |
1889 | (kbdbl_ctl->timeout << 0x10), &ignore); | 1894 | (kbdbl_ctl->timeout << 0x10), &ignore); |
1890 | } | 1895 | } |
1896 | #endif | ||
1891 | 1897 | ||
1892 | struct battery_care_control { | 1898 | struct battery_care_control { |
1893 | struct device_attribute attrs[2]; | 1899 | struct device_attribute attrs[2]; |
@@ -2210,6 +2216,7 @@ static void sony_nc_thermal_cleanup(struct platform_device *pd) | |||
2210 | } | 2216 | } |
2211 | } | 2217 | } |
2212 | 2218 | ||
2219 | #ifdef CONFIG_PM_SLEEP | ||
2213 | static void sony_nc_thermal_resume(void) | 2220 | static void sony_nc_thermal_resume(void) |
2214 | { | 2221 | { |
2215 | unsigned int status = sony_nc_thermal_mode_get(); | 2222 | unsigned int status = sony_nc_thermal_mode_get(); |
@@ -2217,6 +2224,7 @@ static void sony_nc_thermal_resume(void) | |||
2217 | if (status != th_handle->mode) | 2224 | if (status != th_handle->mode) |
2218 | sony_nc_thermal_mode_set(th_handle->mode); | 2225 | sony_nc_thermal_mode_set(th_handle->mode); |
2219 | } | 2226 | } |
2227 | #endif | ||
2220 | 2228 | ||
2221 | /* resume on LID open */ | 2229 | /* resume on LID open */ |
2222 | struct snc_lid_resume_control { | 2230 | struct snc_lid_resume_control { |
@@ -4287,6 +4295,7 @@ err_free_resources: | |||
4287 | return result; | 4295 | return result; |
4288 | } | 4296 | } |
4289 | 4297 | ||
4298 | #ifdef CONFIG_PM_SLEEP | ||
4290 | static int sony_pic_suspend(struct device *dev) | 4299 | static int sony_pic_suspend(struct device *dev) |
4291 | { | 4300 | { |
4292 | if (sony_pic_disable(to_acpi_device(dev))) | 4301 | if (sony_pic_disable(to_acpi_device(dev))) |
@@ -4300,6 +4309,7 @@ static int sony_pic_resume(struct device *dev) | |||
4300 | spic_dev.cur_ioport, spic_dev.cur_irq); | 4309 | spic_dev.cur_ioport, spic_dev.cur_irq); |
4301 | return 0; | 4310 | return 0; |
4302 | } | 4311 | } |
4312 | #endif | ||
4303 | 4313 | ||
4304 | static SIMPLE_DEV_PM_OPS(sony_pic_pm, sony_pic_suspend, sony_pic_resume); | 4314 | static SIMPLE_DEV_PM_OPS(sony_pic_pm, sony_pic_suspend, sony_pic_resume); |
4305 | 4315 | ||