aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-04 03:36:20 -0500
committerLen Brown <len.brown@intel.com>2009-12-16 12:53:33 -0500
commit8e698a3c47887fe5aa5e2252c27bb6ff416a07e4 (patch)
treedb9ab11dd08ba443fc81c87f2478bbc4bb693141
parent9634a627b330fcc7cdca25df4d7853ca9c7745de (diff)
tc1100-wmi - switch to using dev_pm_ops
Also guard PM operations with CONFIG_PM. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/platform/x86/tc1100-wmi.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/platform/x86/tc1100-wmi.c b/drivers/platform/x86/tc1100-wmi.c
index fa2995bfa1d..dd33b51c348 100644
--- a/drivers/platform/x86/tc1100-wmi.c
+++ b/drivers/platform/x86/tc1100-wmi.c
@@ -194,7 +194,8 @@ static int __devexit tc1100_remove(struct platform_device *device)
194 return 0; 194 return 0;
195} 195}
196 196
197static int tc1100_suspend(struct platform_device *dev, pm_message_t state) 197#ifdef CONFIG_PM
198static int tc1100_suspend(struct device *dev)
198{ 199{
199 int ret; 200 int ret;
200 201
@@ -206,10 +207,10 @@ static int tc1100_suspend(struct platform_device *dev, pm_message_t state)
206 if (ret) 207 if (ret)
207 return ret; 208 return ret;
208 209
209 return ret; 210 return 0;
210} 211}
211 212
212static int tc1100_resume(struct platform_device *dev) 213static int tc1100_resume(struct device *dev)
213{ 214{
214 int ret; 215 int ret;
215 216
@@ -221,17 +222,26 @@ static int tc1100_resume(struct platform_device *dev)
221 if (ret) 222 if (ret)
222 return ret; 223 return ret;
223 224
224 return ret; 225 return 0;
225} 226}
226 227
228static const struct dev_pm_ops tc1100_pm_ops = {
229 .suspend = tc1100_suspend,
230 .resume = tc1100_resume,
231 .freeze = tc1100_suspend,
232 .restore = tc1100_resume,
233};
234#endif
235
227static struct platform_driver tc1100_driver = { 236static struct platform_driver tc1100_driver = {
228 .driver = { 237 .driver = {
229 .name = "tc1100-wmi", 238 .name = "tc1100-wmi",
230 .owner = THIS_MODULE, 239 .owner = THIS_MODULE,
240#ifdef CONFIG_PM
241 .pm = &tc1100_pm_ops,
242#endif
231 }, 243 },
232 .remove = __devexit_p(tc1100_remove), 244 .remove = __devexit_p(tc1100_remove),
233 .suspend = tc1100_suspend,
234 .resume = tc1100_resume,
235}; 245};
236 246
237static int __init tc1100_init(void) 247static int __init tc1100_init(void)