diff options
| author | Shawn Lin <shawn.lin@rock-chips.com> | 2026-03-30 06:28:30 +0300 |
|---|---|---|
| committer | Ulf Hansson <ulf.hansson@linaro.org> | 2026-03-31 13:41:31 +0300 |
| commit | 554b0674f22feb76d9198f2f1fa23b610f548548 (patch) | |
| tree | 63f6bb12a0eb41b23184c2eb4506206fa9a024f0 | |
| parent | a38ad7e173bc68c54f7afae7f669a824e313b1bb (diff) | |
| download | linux-554b0674f22feb76d9198f2f1fa23b610f548548.tar.xz | |
mmc: block: Convert to use DEFINE_SIMPLE_DEV_PM_OPS()
Convert to use DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() to drop the
CONFIG_PM_SLEEP to handle the conditional compilation when PM support is
disabled. This allows the compiler to automatically optimize away the
unused code paths when CONFIG_PM_SLEEP is not selected.
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
| -rw-r--r-- | drivers/mmc/core/block.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 5032f7a8ead0..53c1b04f1916 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -3362,7 +3362,6 @@ static void mmc_blk_shutdown(struct mmc_card *card) _mmc_blk_suspend(card); } -#ifdef CONFIG_PM_SLEEP static int mmc_blk_suspend(struct device *dev) { struct mmc_card *card = mmc_dev_to_card(dev); @@ -3388,14 +3387,13 @@ static int mmc_blk_resume(struct device *dev) } return 0; } -#endif -static SIMPLE_DEV_PM_OPS(mmc_blk_pm_ops, mmc_blk_suspend, mmc_blk_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(mmc_blk_pm_ops, mmc_blk_suspend, mmc_blk_resume); static struct mmc_driver mmc_driver = { .drv = { .name = "mmcblk", - .pm = &mmc_blk_pm_ops, + .pm = pm_sleep_ptr(&mmc_blk_pm_ops), }, .probe = mmc_blk_probe, .remove = mmc_blk_remove, |
