Skip to contentSkip to conversation

mmc: jz4740: simplify use of SIMPLE_DEV_PM_OPS

PATCH NAK James Hogan 2 participants 2 messages Aug 19, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: jz4740: simplify use of SIMPLE_DEV_PM_OPS

Commit 5d5c035 (mmc: jz4740: Use SIMPLE_DEV_PM_OPS) converted jz4740_mmc to use SIMPLE_DEV_PM_OPS, but it did so within the #ifdef CONFIG_PM_SLEEP. SIMPLE_DEV_PM_OPS already handles when CONFIG_PM_SLEEP is disabled, so move it out of the ifdef and remove the JZ4740_MMC_PM_OPS indirection.

Compile tested with CONFIG_PM_SLEEP enabled and disabled.

---
 drivers/mmc/host/jz4740_mmc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/mmc/host/jz4740_mmc.c +2 -5
index 0308c9f..28af392 100644
@@ -898,13 +898,10 @@ static int jz4740_mmc_resume(struct device *dev)
 
 	return 0;
 }
+#endif
 
 static SIMPLE_DEV_PM_OPS(jz4740_mmc_pm_ops, jz4740_mmc_suspend,
 	jz4740_mmc_resume);
-#define JZ4740_MMC_PM_OPS (&jz4740_mmc_pm_ops)
-#else
-#define JZ4740_MMC_PM_OPS NULL
-#endif
 
 static struct platform_driver jz4740_mmc_driver = {
 	.probe = jz4740_mmc_probe,
@@ -912,7 +909,7 @@ static struct platform_driver jz4740_mmc_driver = {
 	.driver = {
 		.name = "jz4740-mmc",
 		.owner = THIS_MODULE,
-		.pm = JZ4740_MMC_PM_OPS,
+		.pm = &jz4740_mmc_pm_ops,
 	},
 };
 
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 6 lines · James Hogan

Commit 5d5c035 (mmc: jz4740: Use SIMPLE_DEV_PM_OPS) converted jz4740_mmc to use SIMPLE_DEV_PM_OPS, but it did so within the #ifdef CONFIG_PM_SLEEP. SIMPLE_DEV_PM_OPS already handles when CONFIG_PM_SLEEP is disabled, so move it out of the ifdef and remove the JZ4740_MMC_PM_OPS indirection.

Quoted 6 lines

Compile tested with CONFIG_PM_SLEEP enabled and disabled.

Nack, the generated code is not the same.

Quoted 33 lines
---
  drivers/mmc/host/jz4740_mmc.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
drivers/mmc/host/jz4740_mmc.c +2 -5
index 0308c9f..28af392 100644
@@ -898,13 +898,10 @@ static int jz4740_mmc_resume(struct device *dev)
 
  	return 0;
  }
+#endif
 
  static SIMPLE_DEV_PM_OPS(jz4740_mmc_pm_ops, jz4740_mmc_suspend,
  	jz4740_mmc_resume);
-#define JZ4740_MMC_PM_OPS (&jz4740_mmc_pm_ops)
-#else
-#define JZ4740_MMC_PM_OPS NULL
-#endif
 
  static struct platform_driver jz4740_mmc_driver = {
  	.probe = jz4740_mmc_probe,
@@ -912,7 +909,7 @@ static struct platform_driver jz4740_mmc_driver = {
  	.driver = {
  		.name = "jz4740-mmc",
  		.owner = THIS_MODULE,
-		.pm = JZ4740_MMC_PM_OPS,
+		.pm = &jz4740_mmc_pm_ops,
  	},
  };