netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: "Rafael J . Wysocki" <rafael@kernel.org>,
	Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Jonathan Cameron <jic23@kernel.org>
Cc: list@opendingux.net, linux-mips@vger.kernel.org,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, linux-pm@vger.kernel.org,
	Paul Cercueil <paul@crapouillou.net>
Subject: [PATCH 5/5] mmc: mxc: Use the new PM macros
Date: Tue,  7 Dec 2021 00:21:02 +0000	[thread overview]
Message-ID: <20211207002102.26414-6-paul@crapouillou.net> (raw)
In-Reply-To: <20211207002102.26414-1-paul@crapouillou.net>

Use DEFINE_SIMPLE_DEV_PM_OPS() instead of the SIMPLE_DEV_PM_OPS()
macro, along with using pm_sleep_ptr() as this driver doesn't handle
runtime PM. This makes it possible to remove the #ifdef CONFIG_PM
guard around the suspend/resume functions.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mmc/host/mxcmmc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index 2fe6fcdbb1b3..98c218bd6669 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -1183,7 +1183,6 @@ static int mxcmci_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int mxcmci_suspend(struct device *dev)
 {
 	struct mmc_host *mmc = dev_get_drvdata(dev);
@@ -1210,9 +1209,8 @@ static int mxcmci_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(mxcmci_pm_ops, mxcmci_suspend, mxcmci_resume);
+DEFINE_SIMPLE_DEV_PM_OPS(mxcmci_pm_ops, mxcmci_suspend, mxcmci_resume);
 
 static struct platform_driver mxcmci_driver = {
 	.probe		= mxcmci_probe,
@@ -1220,7 +1218,7 @@ static struct platform_driver mxcmci_driver = {
 	.driver		= {
 		.name		= DRIVER_NAME,
 		.probe_type	= PROBE_PREFER_ASYNCHRONOUS,
-		.pm	= &mxcmci_pm_ops,
+		.pm	= pm_sleep_ptr(&mxcmci_pm_ops),
 		.of_match_table	= mxcmci_of_match,
 	}
 };
-- 
2.33.0


  parent reply	other threads:[~2021-12-07  0:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07  0:20 [PATCH 0/5] Rework pm_ptr() and *_PM_OPS macros Paul Cercueil
2021-12-07  0:20 ` [PATCH 1/5] r8169: Avoid misuse of pm_ptr() macro Paul Cercueil
2021-12-07  0:20 ` [PATCH 2/5] PM: core: Redefine " Paul Cercueil
2021-12-16 11:10   ` Jonathan Cameron
2021-12-07  0:21 ` [PATCH 3/5] PM: core: Add new *_PM_OPS macros, deprecate old ones Paul Cercueil
2021-12-16 11:09   ` Jonathan Cameron
2021-12-07  0:21 ` [PATCH 4/5] mmc: jz4740: Use the new PM macros Paul Cercueil
2021-12-07  0:21 ` Paul Cercueil [this message]
2021-12-07  9:22 ` [PATCH 0/5] Rework pm_ptr() and *_PM_OPS macros Arnd Bergmann
2021-12-17 15:07   ` Rafael J. Wysocki
2021-12-17 17:16     ` Ulf Hansson
2021-12-17 18:22       ` Rafael J. Wysocki

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=20211207002102.26414-6-paul@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=arnd@arndb.de \
    --cc=jic23@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=list@opendingux.net \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    --cc=ulf.hansson@linaro.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).