From: Ulf Hansson <ulf.hansson@linaro.org>
To: linux-mmc@vger.kernel.org, Chris Ball <cjb@laptop.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Subject: [PATCH 2/8] mmc: tmio_mmc: Convert from legacy to modern PM ops
Date: Fri, 8 Nov 2013 07:06:10 +0100 [thread overview]
Message-ID: <1383890776-6912-3-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1383890776-6912-1-git-send-email-ulf.hansson@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
drivers/mmc/host/tmio_mmc.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 8860d4d..42da904 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -23,38 +23,37 @@
#include "tmio_mmc.h"
-#ifdef CONFIG_PM
-static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int tmio_mmc_suspend(struct device *dev)
{
- const struct mfd_cell *cell = mfd_get_cell(dev);
+ struct platform_device *pdev = to_platform_device(dev);
+ const struct mfd_cell *cell = mfd_get_cell(pdev);
int ret;
- ret = tmio_mmc_host_suspend(&dev->dev);
+ ret = tmio_mmc_host_suspend(dev);
/* Tell MFD core it can disable us now.*/
if (!ret && cell->disable)
- cell->disable(dev);
+ cell->disable(pdev);
return ret;
}
-static int tmio_mmc_resume(struct platform_device *dev)
+static int tmio_mmc_resume(struct device *dev)
{
- const struct mfd_cell *cell = mfd_get_cell(dev);
+ struct platform_device *pdev = to_platform_device(dev);
+ const struct mfd_cell *cell = mfd_get_cell(pdev);
int ret = 0;
/* Tell the MFD core we are ready to be enabled */
if (cell->resume)
- ret = cell->resume(dev);
+ ret = cell->resume(pdev);
if (!ret)
- ret = tmio_mmc_host_resume(&dev->dev);
+ ret = tmio_mmc_host_resume(dev);
return ret;
}
-#else
-#define tmio_mmc_suspend NULL
-#define tmio_mmc_resume NULL
#endif
static int tmio_mmc_probe(struct platform_device *pdev)
@@ -125,15 +124,18 @@ static int tmio_mmc_remove(struct platform_device *pdev)
/* ------------------- device registration ----------------------- */
+static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume)
+};
+
static struct platform_driver tmio_mmc_driver = {
.driver = {
.name = "tmio-mmc",
.owner = THIS_MODULE,
+ .pm = &tmio_mmc_dev_pm_ops,
},
.probe = tmio_mmc_probe,
.remove = tmio_mmc_remove,
- .suspend = tmio_mmc_suspend,
- .resume = tmio_mmc_resume,
};
module_platform_driver(tmio_mmc_driver);
--
1.7.9.5
next prev parent reply other threads:[~2013-11-08 6:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-08 6:06 [PATCH 0/8] mmc: tmio: Convert to use runtime PM at request idle Ulf Hansson
2013-11-08 6:06 ` [PATCH 1/8] mmc: sh_mobile_sdhi: Use modern PM macros to define pm callbacks Ulf Hansson
2013-11-08 6:06 ` Ulf Hansson [this message]
2013-11-08 6:06 ` [PATCH 3/8] mmc: tmio: Adapt to proper PM configs for exported functions Ulf Hansson
2013-11-08 6:06 ` [PATCH 4/8] mmc: tmio: Keep host active while SDIO irq is enabled Ulf Hansson
2013-11-08 6:56 ` Guennadi Liakhovetski
2013-11-11 9:07 ` Ulf Hansson
2013-11-08 6:06 ` [PATCH 5/8] mmc: tmio: Keep host active while serving requests Ulf Hansson
2013-11-08 6:06 ` [PATCH 6/8] mmc: tmio: Extract bus_width modifications to a function Ulf Hansson
2013-11-08 6:06 ` [PATCH 7/8] mmc: tmio: Restructure .set_ios and adapt probe sequence to it Ulf Hansson
2013-11-08 6:06 ` [PATCH 8/8] mmc: tmio: Handle clock gating from runtime PM functions Ulf Hansson
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=1383890776-6912-3-git-send-email-ulf.hansson@linaro.org \
--to=ulf.hansson@linaro.org \
--cc=cjb@laptop.org \
--cc=linux-mmc@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;
as well as URLs for NNTP newsgroup(s).