Skip to contentSkip to conversation

ata: pata_imx: Use the SIMPLE_DEV_PM_OPS() macro

PATCH In review Fabio Estevam 2 participants 3 messages Oct 4, 2014 – Oct 5, 2014

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 ata: pata_imx: Use the SIMPLE_DEV_PM_OPS() macro

From: Fabio Estevam <[email protected]>

Using the SIMPLE_DEV_PM_OPS() macro can make the code shorter and cleaner.

---
 drivers/ata/pata_imx.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/ata/pata_imx.c +2 -7
index af42457..989ff5a 100644
@@ -221,13 +221,10 @@ static int pata_imx_resume(struct device *dev)
 
 	return 0;
 }
-
-static const struct dev_pm_ops pata_imx_pm_ops = {
-	.suspend	= pata_imx_suspend,
-	.resume		= pata_imx_resume,
-};
 #endif
 
+static SIMPLE_DEV_PM_OPS(pata_imx_pm_ops, pata_imx_suspend, pata_imx_resume);
+
 static const struct of_device_id imx_pata_dt_ids[] = {
 	{
 		.compatible = "fsl,imx27-pata",
@@ -244,9 +241,7 @@ static struct platform_driver pata_imx_driver = {
 		.name		= DRV_NAME,
 		.of_match_table	= imx_pata_dt_ids,
 		.owner		= THIS_MODULE,
-#ifdef CONFIG_PM_SLEEP
 		.pm		= &pata_imx_pm_ops,
-#endif
 	},
 };
 
Signature · 1 line
1.9.1
author reviewer
#2 lore raw
Quoted 8 lines · Tejun Heo
Quoted 5 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Using the SIMPLE_DEV_PM_OPS() macro can make the code shorter and cleaner.

Applied to libata/for-3.18. Care to convert other drivers too?

Yes, I can submit patches for other drivers too. Thanks