Skip to contentSkip to conversation

staging/sm7xxfb: Convert to SIMPLE_DEV_PM_OPS

PATCH In review Peter Huewe 2 participants 2 messages Feb 18, 2013 – Feb 19, 2013 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging/sm7xxfb: Convert to SIMPLE_DEV_PM_OPS

Instead of assigning the pm_ops fields individually we can simply use SIMPLE_DEV_PM_OPS.

---
 drivers/staging/sm7xxfb/sm7xxfb.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)
drivers/staging/sm7xxfb/sm7xxfb.c +1 -9
index 0764bbb..8add64b 100644
@@ -1006,15 +1006,7 @@ static int smtcfb_pci_resume(struct device *device)
 	return 0;
 }
 
-static const struct dev_pm_ops sm7xx_pm_ops = {
-	.suspend = smtcfb_pci_suspend,
-	.resume = smtcfb_pci_resume,
-	.freeze = smtcfb_pci_suspend,
-	.thaw = smtcfb_pci_resume,
-	.poweroff = smtcfb_pci_suspend,
-	.restore = smtcfb_pci_resume,
-};
-
+static SIMPLE_DEV_PM_OPS(sm7xx_pm_ops, smtcfb_pci_suspend, smtcfb_pci_resume);
 #define SM7XX_PM_OPS (&sm7xx_pm_ops)
 
 #else  /* !CONFIG_PM */
Signature · 1 line
1.7.8.6
Acked-by on v1 1/1
#1 lore raw

Thanks!

Quoted 29 lines · Peter Huewe

Instead of assigning the pm_ops fields individually we can simply use SIMPLE_DEV_PM_OPS.

---
 drivers/staging/sm7xxfb/sm7xxfb.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)
drivers/staging/sm7xxfb/sm7xxfb.c +1 -9
index 0764bbb..8add64b 100644
@@ -1006,15 +1006,7 @@ static int smtcfb_pci_resume(struct device *device)
 	return 0;
 }
 
-static const struct dev_pm_ops sm7xx_pm_ops = {
-	.suspend = smtcfb_pci_suspend,
-	.resume = smtcfb_pci_resume,
-	.freeze = smtcfb_pci_suspend,
-	.thaw = smtcfb_pci_resume,
-	.poweroff = smtcfb_pci_suspend,
-	.restore = smtcfb_pci_resume,
-};
-
+static SIMPLE_DEV_PM_OPS(sm7xx_pm_ops, smtcfb_pci_suspend, smtcfb_pci_resume);
 #define SM7XX_PM_OPS (&sm7xx_pm_ops)
 
 #else  /* !CONFIG_PM */