]> git.hungrycats.org Git - linux/commitdiff
mmc: mxc: Use the new PM macros
authorPaul Cercueil <paul@crapouillou.net>
Tue, 7 Dec 2021 00:21:02 +0000 (00:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:21:54 +0000 (13:21 +0100)
[ Upstream commit 2cdbd92c2d1dff07ad56c39f5857ee644bbd2c8a ]

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>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 18ab69c8ca56 ("Input: iqs269a - do not poll during suspend or resume")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/host/mxcmmc.c

index 97227ad7171507d8d9905616a4c41756ab2523cb..b5f65f39ced1cb75b0b68eae08b2ef8dc564668b 100644 (file)
@@ -1185,7 +1185,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);
@@ -1212,9 +1211,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,
@@ -1222,7 +1220,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,
        }
 };