From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Len Brown <len.brown@intel.com>,
Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: linux-acpi@vger.kernel.org
Subject: [PATCH 3/3] tc1100-wmi - switch to using dev_pm_ops
Date: Fri, 04 Dec 2009 00:36:20 -0800 [thread overview]
Message-ID: <20091204083620.22509.60571.stgit@localhost.localdomain> (raw)
In-Reply-To: <20091204083422.22509.74768.stgit@localhost.localdomain>
Also guard PM operations with CONFIG_PM.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/platform/x86/tc1100-wmi.c | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/platform/x86/tc1100-wmi.c b/drivers/platform/x86/tc1100-wmi.c
index fa2995b..dd33b51 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)
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;
@@ -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;
@@ -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)
next prev parent reply other threads:[~2009-12-04 8:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-04 8:36 [PATCH 0/3] A few fixes to TC1100-WMI driver Dmitry Torokhov
2009-12-04 8:36 ` [PATCH 1/3] tc1100-wmi - switch to using attribute group Dmitry Torokhov
2009-12-04 8:36 ` [PATCH 2/3] tc1100-wmi - add error handling for device registration Dmitry Torokhov
2009-12-04 8:36 ` Dmitry Torokhov [this message]
2009-12-16 17:55 ` [PATCH 0/3] A few fixes to TC1100-WMI driver Len Brown
2009-12-16 22:35 ` Carlos Corbacho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091204083620.22509.60571.stgit@localhost.localdomain \
--to=dmitry.torokhov@gmail.com \
--cc=carlos@strangeworlds.co.uk \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox