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 4/4] hwmon / exynos4_tmu: Use struct dev_pm_ops for power management
Date: Sat, 7 Jul 2012 23:06:08 +0200 [thread overview]
Message-ID: <201207072306.09305.rjw@sisk.pl> (raw)
In-Reply-To: <201207072302.16491.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
Make the Exynos4 TMU 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/exynos4_tmu.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
Index: linux/drivers/hwmon/exynos4_tmu.c
===================================================================
--- linux.orig/drivers/hwmon/exynos4_tmu.c
+++ linux/drivers/hwmon/exynos4_tmu.c
@@ -476,34 +476,37 @@ static int __devexit exynos4_tmu_remove(
}
#ifdef CONFIG_PM
-static int exynos4_tmu_suspend(struct platform_device *pdev, pm_message_t state)
+static int exynos4_tmu_suspend(struct device *dev)
{
- exynos4_tmu_control(pdev, false);
+ exynos4_tmu_control(to_platform_device(dev), false);
return 0;
}
-static int exynos4_tmu_resume(struct platform_device *pdev)
+static int exynos4_tmu_resume(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
+
exynos4_tmu_initialize(pdev);
exynos4_tmu_control(pdev, true);
return 0;
}
+
+static SIMPLE_DEV_PM_OPS(exynos4_tmu_pm, exynos4_tmu_suspend, exynos4_tmu_resume);
+#define EXYNOS4_TMU_PM (&exynos4_tmu_pm)
#else
-#define exynos4_tmu_suspend NULL
-#define exynos4_tmu_resume NULL
+#define EXYNOS4_TMU_PM NULL
#endif
static struct platform_driver exynos4_tmu_driver = {
.driver = {
.name = "exynos4-tmu",
.owner = THIS_MODULE,
+ .pm = EXYNOS4_TMU_PM,
},
.probe = exynos4_tmu_probe,
.remove = __devexit_p(exynos4_tmu_remove),
- .suspend = exynos4_tmu_suspend,
- .resume = exynos4_tmu_resume,
};
module_platform_driver(exynos4_tmu_driver);
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 ` [PATCH 1/4] hwmon / abituguru: Use struct dev_pm_ops for power management Rafael J. Wysocki
2012-07-07 21:59 ` [PATCH 1/4][update] " 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 ` Rafael J. Wysocki [this message]
2012-07-08 17:02 ` [PATCH 4/4] hwmon / exynos4_tmu: " 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=201207072306.09305.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