Skip to content

Commit

Permalink
tc1100-wmi - switch to using dev_pm_ops
Browse files Browse the repository at this point in the history
Also guard PM operations with CONFIG_PM.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Dmitry Torokhov authored and Len Brown committed Dec 16, 2009
1 parent 9634a62 commit 8e698a3
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions drivers/platform/x86/tc1100-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ static int __devexit tc1100_remove(struct platform_device *device)
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;

Expand All @@ -206,10 +207,10 @@ static int tc1100_suspend(struct platform_device *dev, pm_message_t state)
if (ret)
return ret;

return ret;
return 0;
}

static int tc1100_resume(struct platform_device *dev)
static int tc1100_resume(struct device *dev)
{
int ret;

Expand All @@ -221,17 +222,26 @@ static int tc1100_resume(struct platform_device *dev)
if (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 = {
.driver = {
.name = "tc1100-wmi",
.owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &tc1100_pm_ops,
#endif
},
.remove = __devexit_p(tc1100_remove),
.suspend = tc1100_suspend,
.resume = tc1100_resume,
};

static int __init tc1100_init(void)
Expand Down

0 comments on commit 8e698a3

Please sign in to comment.