Commit 8e698a3c authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Len Brown

tc1100-wmi - switch to using dev_pm_ops

Also guard PM operations with CONFIG_PM.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 9634a627
...@@ -194,7 +194,8 @@ static int __devexit tc1100_remove(struct platform_device *device) ...@@ -194,7 +194,8 @@ static int __devexit tc1100_remove(struct platform_device *device)
return 0; return 0;
} }
static int tc1100_suspend(struct platform_device *dev, pm_message_t state) #ifdef CONFIG_PM
static int tc1100_suspend(struct device *dev)
{ {
int ret; int ret;
...@@ -206,10 +207,10 @@ static int tc1100_suspend(struct platform_device *dev, pm_message_t state) ...@@ -206,10 +207,10 @@ static int tc1100_suspend(struct platform_device *dev, pm_message_t state)
if (ret) if (ret)
return ret; return ret;
return ret; return 0;
} }
static int tc1100_resume(struct platform_device *dev) static int tc1100_resume(struct device *dev)
{ {
int ret; int ret;
...@@ -221,17 +222,26 @@ static int tc1100_resume(struct platform_device *dev) ...@@ -221,17 +222,26 @@ static int tc1100_resume(struct platform_device *dev)
if (ret) if (ret)
return ret; return ret;
return ret; return 0;
} }
static const struct dev_pm_ops tc1100_pm_ops = {
.suspend = tc1100_suspend,
.resume = tc1100_resume,
.freeze = tc1100_suspend,
.restore = tc1100_resume,
};
#endif
static struct platform_driver tc1100_driver = { static struct platform_driver tc1100_driver = {
.driver = { .driver = {
.name = "tc1100-wmi", .name = "tc1100-wmi",
.owner = THIS_MODULE, .owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &tc1100_pm_ops,
#endif
}, },
.remove = __devexit_p(tc1100_remove), .remove = __devexit_p(tc1100_remove),
.suspend = tc1100_suspend,
.resume = tc1100_resume,
}; };
static int __init tc1100_init(void) static int __init tc1100_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment