From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Linux PM list <linux-pm@vger.kernel.org>,
Hans de Goede <hdegoede@redhat.com>,
Alistair John Strachan <alistair@devzero.co.uk>,
lm-sensors@lm-sensors.org, Jean Delvare <khali@linux-fr.org>,
Guenter Roeck <linux@roeck-us.net>,
Kukjin Kim <kgene.kim@samsung.com>
Subject: [PATCH 1/4] hwmon / abituguru: Use struct dev_pm_ops for power management
Date: Sat, 7 Jul 2012 23:04:09 +0200 [thread overview]
Message-ID: <201207072304.10067.rjw@sisk.pl> (raw)
In-Reply-To: <201207072302.16491.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
Make the Abit uGuru driver define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct platform_driver.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/hwmon/abituguru.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
Index: linux/drivers/hwmon/abituguru.c
===================================================================
--- linux.orig/drivers/hwmon/abituguru.c
+++ linux/drivers/hwmon/abituguru.c
@@ -1514,9 +1514,11 @@ LEAVE_UPDATE:
}
#ifdef CONFIG_PM
-static int abituguru_suspend(struct platform_device *pdev, pm_message_t state)
+static int abituguru_suspend(struct device *dev)
{
- struct abituguru_data *data = platform_get_drvdata(pdev);
+ struct abituguru_data *data;
+
+ data = platform_get_drvdata(to_platform_device(dev));
/*
* make sure all communications with the uguru are done and no new
* ones are started
@@ -1525,29 +1527,32 @@ static int abituguru_suspend(struct plat
return 0;
}
-static int abituguru_resume(struct platform_device *pdev)
+static int abituguru_resume(struct device *dev)
{
- struct abituguru_data *data = platform_get_drvdata(pdev);
+ struct abituguru_data *data;
+
+ data = platform_get_drvdata(to_platform_device(dev));
/* See if the uGuru is still ready */
if (inb_p(data->addr + ABIT_UGURU_DATA) != ABIT_UGURU_STATUS_INPUT)
data->uguru_ready = 0;
mutex_unlock(&data->update_lock);
return 0;
}
+
+static SIMPLE_DEV_PM_OPS(abituguru_pm, abituguru_suspend, abituguru_resume);
+#define ABIT_UGURU_PM (&abituguru_pm)
#else
-#define abituguru_suspend NULL
-#define abituguru_resume NULL
+#define ABIT_UGURU_PM NULL
#endif /* CONFIG_PM */
static struct platform_driver abituguru_driver = {
.driver = {
.owner = THIS_MODULE,
.name = ABIT_UGURU_NAME,
+ .pm = ABIT_UGURU_PM,
},
.probe = abituguru_probe,
.remove = __devexit_p(abituguru_remove),
- .suspend = abituguru_suspend,
- .resume = abituguru_resume,
};
static int __init abituguru_detect(void)
next prev parent reply other threads:[~2012-07-07 21:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-07 21:02 [PATCH 0/4] PM / hwmon: Convert platform hwmon drivers to PM handling based on struct dev_pm_ops Rafael J. Wysocki
2012-07-07 21:04 ` Rafael J. Wysocki [this message]
2012-07-07 21:59 ` [PATCH 1/4][update] hwmon / abituguru: Use struct dev_pm_ops for power management Rafael J. Wysocki
2012-07-08 17:06 ` Guenter Roeck
2012-07-07 21:04 ` [PATCH 2/4] hwmon / abituguru3: " Rafael J. Wysocki
2012-07-07 22:00 ` [PATCH 2/4][update] " Rafael J. Wysocki
2012-07-08 17:06 ` Guenter Roeck
2012-07-07 21:05 ` [PATCH 3/4] hwmon / gpio-fan: " Rafael J. Wysocki
2012-07-07 22:01 ` [PATCH 3/4][update] " Rafael J. Wysocki
2012-07-08 17:07 ` Guenter Roeck
2012-07-07 21:06 ` [PATCH 4/4] hwmon / exynos4_tmu: " Rafael J. Wysocki
2012-07-08 17:02 ` Guenter Roeck
2012-07-08 19:48 ` [PATCH 4/4][update] " Rafael J. Wysocki
2012-07-08 20:30 ` Guenter Roeck
2012-07-08 20:46 ` Rafael J. Wysocki
2012-07-09 4:42 ` Guenter Roeck
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=201207072304.10067.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=alistair@devzero.co.uk \
--cc=hdegoede@redhat.com \
--cc=kgene.kim@samsung.com \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lm-sensors@lm-sensors.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