From: Lars-Peter Clausen <lars@metafoo.de>
To: Anton Vorontsov <cbou@mail.ru>, David Woodhouse <dwmw2@infradead.org>
Cc: linux-kernel@vger.kernel.org,
Lars-Peter Clausen <lars@metafoo.de>,
Rhyland Klein <rklein@nvidia.com>
Subject: [PATCH 3/5] power: sbs-battery: Use dev_pm_ops
Date: Sun, 10 Mar 2013 14:34:07 +0100 [thread overview]
Message-ID: <1362922449-27531-3-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1362922449-27531-1-git-send-email-lars@metafoo.de>
Use dev_pm_ops instead of the deprecated legacy suspend/resume callbacks.
Cc: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/power/sbs-battery.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/power/sbs-battery.c b/drivers/power/sbs-battery.c
index 3960f0b..6a2e335 100644
--- a/drivers/power/sbs-battery.c
+++ b/drivers/power/sbs-battery.c
@@ -820,10 +820,11 @@ static int sbs_remove(struct i2c_client *client)
return 0;
}
-#if defined CONFIG_PM
-static int sbs_suspend(struct i2c_client *client,
- pm_message_t state)
+#if defined CONFIG_PM_SLEEP
+
+static int sbs_suspend(struct device *dev)
{
+ struct i2c_client *client = to_i2c_client(dev);
struct sbs_info *chip = i2c_get_clientdata(client);
s32 ret;
@@ -838,11 +839,13 @@ static int sbs_suspend(struct i2c_client *client,
return 0;
}
+
+static SIMPLE_DEV_PM_OPS(sbs_pm_ops, sbs_suspend, NULL);
+#define SBS_PM_OPS (&sbs_pm_ops)
+
#else
-#define sbs_suspend NULL
+#define SBS_PM_OPS NULL
#endif
-/* any smbus transaction will wake up sbs */
-#define sbs_resume NULL
static const struct i2c_device_id sbs_id[] = {
{ "bq20z75", 0 },
@@ -854,12 +857,11 @@ MODULE_DEVICE_TABLE(i2c, sbs_id);
static struct i2c_driver sbs_battery_driver = {
.probe = sbs_probe,
.remove = sbs_remove,
- .suspend = sbs_suspend,
- .resume = sbs_resume,
.id_table = sbs_id,
.driver = {
.name = "sbs-battery",
.of_match_table = sbs_dt_ids,
+ .pm = SBS_PM_OPS,
},
};
module_i2c_driver(sbs_battery_driver);
--
1.8.0
next prev parent reply other threads:[~2013-03-10 13:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-10 13:34 [PATCH 1/5] power: ds2782_battery: Use dev_pm_ops Lars-Peter Clausen
2013-03-10 13:34 ` [PATCH 2/5] power: max17040_battery: " Lars-Peter Clausen
2013-03-12 5:59 ` Minkyu Kang
2013-04-01 6:00 ` Anton Vorontsov
2013-03-10 13:34 ` Lars-Peter Clausen [this message]
2013-03-11 18:05 ` [PATCH 3/5] power: sbs-battery: " Rhyland Klein
2013-03-10 13:34 ` [PATCH 4/5] power: pm2301_charger: Remove __dev* annotations Lars-Peter Clausen
2013-03-25 3:09 ` Anton Vorontsov
2013-03-10 13:34 ` [PATCH 5/5] power: pm2301_charger: Remove no-op suspend/resume callbacks Lars-Peter Clausen
2013-04-01 6:00 ` [PATCH 1/5] power: ds2782_battery: Use dev_pm_ops Anton Vorontsov
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=1362922449-27531-3-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=cbou@mail.ru \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rklein@nvidia.com \
/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;
as well as URLs for NNTP newsgroup(s).