All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben@simtec.co.uk>
To: linux-mmc@vger.kernel.org
Subject: [patch 4/9] s3cmci: Change to use dev_pm_ops
Date: Tue, 18 Aug 2009 12:56:08 +0100	[thread overview]
Message-ID: <20090818115659.191590035@fluff.org> (raw)
In-Reply-To: 20090818115604.056816271@fluff.org

[-- Attachment #1: s3cmci-use-pmops.patch --]
[-- Type: text/plain, Size: 1900 bytes --]

Move to using dev_pm_ops for suspend and resume.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>

---
 drivers/mmc/host/s3cmci.c |   29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

Index: b/drivers/mmc/host/s3cmci.c
===================================================================
--- a/drivers/mmc/host/s3cmci.c	2009-08-04 12:14:05.000000000 +0100
+++ b/drivers/mmc/host/s3cmci.c	2009-08-04 12:23:03.000000000 +0100
@@ -1546,35 +1546,42 @@ MODULE_DEVICE_TABLE(platform, s3cmci_dri
 
 #ifdef CONFIG_PM
 
-static int s3cmci_suspend(struct platform_device *dev, pm_message_t state)
+static int s3cmci_suspend(struct device *dev)
 {
-	struct mmc_host *mmc = platform_get_drvdata(dev);
+	struct mmc_host *mmc = platform_get_drvdata(to_platform_device(dev));
+	struct pm_message event = { PM_EVENT_SUSPEND };
 
-	return  mmc_suspend_host(mmc, state);
+	return mmc_suspend_host(mmc, event);
 }
 
-static int s3cmci_resume(struct platform_device *dev)
+static int s3cmci_resume(struct device *dev)
 {
-	struct mmc_host *mmc = platform_get_drvdata(dev);
+	struct mmc_host *mmc = platform_get_drvdata(to_platform_device(dev));
 
 	return mmc_resume_host(mmc);
 }
 
+static struct dev_pm_ops s3cmci_pm = {
+	.suspend	= s3cmci_suspend,
+	.resume		= s3cmci_resume,
+};
+
+#define s3cmci_pm_ops &s3cmci_pm
 #else /* CONFIG_PM */
-#define s3cmci_suspend NULL
-#define s3cmci_resume NULL
+#define s3cmci_pm_ops NULL
 #endif /* CONFIG_PM */
 
 
 static struct platform_driver s3cmci_driver = {
-	.driver.name	= "s3c-sdi",
-	.driver.owner	= THIS_MODULE,
+	.driver	= {
+		.name	= "s3c-sdi",
+		.owner	= THIS_MODULE,
+		.pm	= s3cmci_pm_ops,
+	},
 	.id_table	= s3cmci_driver_ids,
 	.probe		= s3cmci_probe,
 	.remove		= __devexit_p(s3cmci_remove),
 	.shutdown	= s3cmci_shutdown,
-	.suspend	= s3cmci_suspend,
-	.resume		= s3cmci_resume,
 };
 
 static int __init s3cmci_init(void)

-- 

  parent reply	other threads:[~2009-08-18 11:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-18 11:56 [patch 0/9] s3cmci driver updates for next kernel merge Ben Dooks
2009-08-18 11:56 ` [patch 1/9] s3cmci: Use resource_size() instead of local macro Ben Dooks
2009-08-18 11:56 ` [patch 2/9] s3cmci: update probe to use new platform id list Ben Dooks
2009-08-18 11:56 ` [patch 3/9] s3cmci: Change GPIO to gpiolib from S3C24XX specific calls Ben Dooks
2009-08-18 11:56 ` Ben Dooks [this message]
2009-08-18 11:56 ` [patch 5/9] s3cmci: Fix direct write to interrupt mask Ben Dooks
2009-08-18 11:56 ` [patch 6/9] s3cmci: Add debugfs support for examining driver and hardware state Ben Dooks
2009-08-18 11:56 ` [patch 7/9] s3cmci: Add SDIO IRQ support Ben Dooks
2009-08-18 11:56 ` [patch 8/9] s3cmci: Kconfig selection for PIO/DMA/Both Ben Dooks
2009-08-18 11:56 ` [patch 9/9] s3cmci: DMA fixes Ben Dooks

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=20090818115659.191590035@fluff.org \
    --to=ben@simtec.co.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.