[PATCH v2 04/12] mtd: physmap: Remove #ifdef guards around shutdown callback

Paul Cercueil paul.cercueil at bootlin.com
Tue Nov 17 01:37:42 PST 2026


physmap_flash_shutdown() calls mtd_suspend() and mtd_resume().

Unlike what their names suggest, those two functions aren't related to
CONFIG_PM, and neither is the platform_driver.shutdown() callback.

Signed-off-by: Paul Cercueil <paul.cercueil at bootlin.com>
---

v2: Don't use pm_ptr(), and rewrite commit message
---
 drivers/mtd/maps/physmap-core.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/mtd/maps/physmap-core.c b/drivers/mtd/maps/physmap-core.c
index dcda7685fc99..672747890972 100644
--- a/drivers/mtd/maps/physmap-core.c
+++ b/drivers/mtd/maps/physmap-core.c
@@ -600,7 +600,6 @@ static int physmap_flash_probe(struct platform_device *dev)
 	return err;
 }
 
-#ifdef CONFIG_PM
 static void physmap_flash_shutdown(struct platform_device *dev)
 {
 	struct physmap_flash_info *info = platform_get_drvdata(dev);
@@ -610,9 +609,6 @@ static void physmap_flash_shutdown(struct platform_device *dev)
 		if (mtd_suspend(info->mtds[i]) == 0)
 			mtd_resume(info->mtds[i]);
 }
-#else
-#define physmap_flash_shutdown NULL
-#endif
 
 static struct platform_driver physmap_flash_driver = {
 	.probe		= physmap_flash_probe,
-- 
2.47.3




More information about the linux-mtd mailing list