From: Lars-Peter Clausen <lars@metafoo.de>
To: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
Lars-Peter Clausen <lars@metafoo.de>,
Rodolfo Giometti <giometti@enneenne.com>
Subject: [PATCH 4/4] misc: tsl2550: Use dev_pm_ops
Date: Thu, 11 Apr 2013 11:24:42 +0200 [thread overview]
Message-ID: <1365672282-10449-4-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1365672282-10449-1-git-send-email-lars@metafoo.de>
Use dev_pm_ops instead of the deprecated legacy suspend/resume callbacks.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Rodolfo Giometti <giometti@enneenne.com>
---
drivers/misc/tsl2550.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/drivers/misc/tsl2550.c b/drivers/misc/tsl2550.c
index 1e7bc0e..1dfde4d 100644
--- a/drivers/misc/tsl2550.c
+++ b/drivers/misc/tsl2550.c
@@ -417,24 +417,26 @@ static int tsl2550_remove(struct i2c_client *client)
return 0;
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
-static int tsl2550_suspend(struct i2c_client *client, pm_message_t mesg)
+static int tsl2550_suspend(struct device *dev)
{
- return tsl2550_set_power_state(client, 0);
+ return tsl2550_set_power_state(to_i2c_client(dev), 0);
}
-static int tsl2550_resume(struct i2c_client *client)
+static int tsl2550_resume(struct device *dev)
{
- return tsl2550_set_power_state(client, 1);
+ return tsl2550_set_power_state(to_i2c_client(dev), 1);
}
+static SIMPLE_DEV_PM_OPS(tsl2550_pm_ops, tsl2550_suspend, tsl2550_resume);
+#define TSL2550_PM_OPS (&tsl2550_pm_ops)
+
#else
-#define tsl2550_suspend NULL
-#define tsl2550_resume NULL
+#define TSL2550_PM_OPS NULL
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM_SLEEP */
static const struct i2c_device_id tsl2550_id[] = {
{ "tsl2550", 0 },
@@ -446,9 +448,8 @@ static struct i2c_driver tsl2550_driver = {
.driver = {
.name = TSL2550_DRV_NAME,
.owner = THIS_MODULE,
+ .pm = TSL2550_PM_OPS,
},
- .suspend = tsl2550_suspend,
- .resume = tsl2550_resume,
.probe = tsl2550_probe,
.remove = tsl2550_remove,
.id_table = tsl2550_id,
--
1.8.0
prev parent reply other threads:[~2013-04-11 9:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-11 9:24 [PATCH 1/4] misc: apds9802als: Fix suspend/resume Lars-Peter Clausen
2013-04-11 9:24 ` [PATCH 2/4] misc: fsa8480: Use dev_pm_ops Lars-Peter Clausen
2013-04-11 9:24 ` [PATCH 3/4] misc: isl29003: " Lars-Peter Clausen
2013-04-11 9:24 ` Lars-Peter Clausen [this message]
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=1365672282-10449-4-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=arnd@arndb.de \
--cc=giometti@enneenne.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®