Skip to contentSkip to conversation

rtc: rtc-at91rm9200: switch to using SIMPLE_DEV_PM_OPS

PATCH New Jingoo Han 1 participant 10 messages Mar 18, 2013

Subsystems (4)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/10 rtc: rtc-at91rm9200: switch to using SIMPLE_DEV_PM_OPS

Switch to using SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. It reduces code size.

---
 drivers/rtc/rtc-at91rm9200.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)
drivers/rtc/rtc-at91rm9200.c +4 -12
index f63c8fe..f07bd31 100644
@@ -337,7 +337,7 @@ static int __exit at91_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 
 /* AT91RM9200 RTC Power management control */
 
@@ -369,24 +369,16 @@ static int at91_rtc_resume(struct device *dev)
 	}
 	return 0;
 }
-
-static const struct dev_pm_ops at91_rtc_pm = {
-	.suspend =	at91_rtc_suspend,
-	.resume =	at91_rtc_resume,
-};
-
-#define at91_rtc_pm_ptr	&at91_rtc_pm
-
-#else
-#define at91_rtc_pm_ptr	NULL
 #endif
 
+static SIMPLE_DEV_PM_OPS(at91_rtc_pm_ops, at91_rtc_suspend, at91_rtc_resume);
+
 static struct platform_driver at91_rtc_driver = {
 	.remove		= __exit_p(at91_rtc_remove),
 	.driver		= {
 		.name	= "at91_rtc",
 		.owner	= THIS_MODULE,
-		.pm	= at91_rtc_pm_ptr,
+		.pm	= &at91_rtc_pm_ops,
 	},
 };
 
Signature · 1 line
1.7.2.5
author
#1 lore raw

PATCH 2/10 rtc: rtc-mxc: switch to using SIMPLE_DEV_PM_OPS

Switch to using SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. It reduces code size.

---
 drivers/rtc/rtc-mxc.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
drivers/rtc/rtc-mxc.c +3 -8
index 13380ca..9a3895b 100644
@@ -470,7 +470,7 @@ static int mxc_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int mxc_rtc_suspend(struct device *dev)
 {
 	struct rtc_plat_data *pdata = dev_get_drvdata(dev);
@@ -490,19 +490,14 @@ static int mxc_rtc_resume(struct device *dev)
 
 	return 0;
 }
-
-static struct dev_pm_ops mxc_rtc_pm_ops = {
-	.suspend	= mxc_rtc_suspend,
-	.resume		= mxc_rtc_resume,
-};
 #endif
 
+static SIMPLE_DEV_PM_OPS(mxc_rtc_pm_ops, mxc_rtc_suspend, mxc_rtc_resume);
+
 static struct platform_driver mxc_rtc_driver = {
 	.driver = {
 		   .name	= "mxc_rtc",
-#ifdef CONFIG_PM
 		   .pm		= &mxc_rtc_pm_ops,
-#endif
 		   .owner	= THIS_MODULE,
 	},
 	.id_table = imx_rtc_devtype,
Signature · 1 line
1.7.2.5
author
#2 lore raw

PATCH 3/10 rtc: rtc-pxa: switch to using SIMPLE_DEV_PM_OPS

In reply to Jingoo Han

Switch to using SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. It reduces code size.

---
 drivers/rtc/rtc-pxa.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
drivers/rtc/rtc-pxa.c +3 -8
index 72e13da..a2c75c1 100644
@@ -466,7 +466,7 @@ static struct of_device_id pxa_rtc_dt_ids[] = {
 MODULE_DEVICE_TABLE(of, pxa_rtc_dt_ids);
 #endif
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int pxa_rtc_suspend(struct device *dev)
 {
 	struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev);
@@ -484,21 +484,16 @@ static int pxa_rtc_resume(struct device *dev)
 		disable_irq_wake(pxa_rtc->irq_Alrm);
 	return 0;
 }
-
-static const struct dev_pm_ops pxa_rtc_pm_ops = {
-	.suspend	= pxa_rtc_suspend,
-	.resume		= pxa_rtc_resume,
-};
 #endif
 
+static SIMPLE_DEV_PM_OPS(pxa_rtc_pm_ops, pxa_rtc_suspend, pxa_rtc_resume);
+
 static struct platform_driver pxa_rtc_driver = {
 	.remove		= __exit_p(pxa_rtc_remove),
 	.driver		= {
 		.name	= "pxa-rtc",
 		.of_match_table = of_match_ptr(pxa_rtc_dt_ids),
-#ifdef CONFIG_PM
 		.pm	= &pxa_rtc_pm_ops,
-#endif
 	},
 };
 
Signature · 1 line
1.7.2.5
author
#3 lore raw

PATCH 4/10 rtc: rtc-rc5t583: switch to using SIMPLE_DEV_PM_OPS

In reply to Jingoo Han

Switch to using SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. It reduces code size.

---
 drivers/rtc/rtc-rc5t583.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
drivers/rtc/rtc-rc5t583.c +4 -11
index eb3194d..1734e97 100644
@@ -282,7 +282,6 @@ static int rc5t583_rtc_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM_SLEEP
-
 static int rc5t583_rtc_suspend(struct device *dev)
 {
 	struct rc5t583 *rc5t583 = dev_get_drvdata(dev->parent);
@@ -304,24 +303,18 @@ static int rc5t583_rtc_resume(struct device *dev)
 	return regmap_write(rc5t583->regmap, RC5T583_RTC_CTL1,
 		rc5t583_rtc->irqen);
 }
-
-static const struct dev_pm_ops rc5t583_rtc_pm_ops = {
-	.suspend	= rc5t583_rtc_suspend,
-	.resume		= rc5t583_rtc_resume,
-};
-
-#define DEV_PM_OPS     (&rc5t583_rtc_pm_ops)
-#else
-#define DEV_PM_OPS     NULL
 #endif
 
+static SIMPLE_DEV_PM_OPS(rc5t583_rtc_pm_ops, rc5t583_rtc_suspend,
+			rc5t583_rtc_resume);
+
 static struct platform_driver rc5t583_rtc_driver = {
 	.probe		= rc5t583_rtc_probe,
 	.remove		= rc5t583_rtc_remove,
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= "rtc-rc5t583",
-		.pm	= DEV_PM_OPS,
+		.pm	= &rc5t583_rtc_pm_ops,
 	},
 };
 
Signature · 1 line
1.7.2.5
author
#4 lore raw

PATCH 5/10 rtc: rtc-sa1100: switch to using SIMPLE_DEV_PM_OPS

In reply to Jingoo Han

Switch to using SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. It reduces code size.

---
 drivers/rtc/rtc-sa1100.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
drivers/rtc/rtc-sa1100.c +4 -8
index 5ec5036..7e0a088 100644
@@ -327,7 +327,7 @@ static int sa1100_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int sa1100_rtc_suspend(struct device *dev)
 {
 	struct sa1100_rtc *info = dev_get_drvdata(dev);
@@ -343,13 +343,11 @@ static int sa1100_rtc_resume(struct device *dev)
 		disable_irq_wake(info->irq_alarm);
 	return 0;
 }
-
-static const struct dev_pm_ops sa1100_rtc_pm_ops = {
-	.suspend	= sa1100_rtc_suspend,
-	.resume		= sa1100_rtc_resume,
-};
 #endif
 
+static SIMPLE_DEV_PM_OPS(sa1100_rtc_pm_ops, sa1100_rtc_suspend,
+			sa1100_rtc_resume);
+
 #ifdef CONFIG_OF
 static struct of_device_id sa1100_rtc_dt_ids[] = {
 	{ .compatible = "mrvl,sa1100-rtc", },
@@ -364,9 +362,7 @@ static struct platform_driver sa1100_rtc_driver = {
 	.remove		= sa1100_rtc_remove,
 	.driver		= {
 		.name	= "sa1100-rtc",
-#ifdef CONFIG_PM
 		.pm	= &sa1100_rtc_pm_ops,
-#endif
 		.of_match_table = of_match_ptr(sa1100_rtc_dt_ids),
 	},
 };
Signature · 1 line
1.7.2.5
author
#5 lore raw

PATCH 6/10 rtc: rtc-sh: switch to using SIMPLE_DEV_PM_OPS

In reply to Jingoo Han

Switch to using SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. It reduces code size. Also, CONFIG_PM_SLEEP is added to prevent build warning when CONFIG_PM_SLEEP is not selected.

---
 drivers/rtc/rtc-sh.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/rtc/rtc-sh.c +4 -5
index 5f47085..8d5bd2e 100644
@@ -790,6 +790,7 @@ static void sh_rtc_set_irq_wake(struct device *dev, int enabled)
 	}
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int sh_rtc_suspend(struct device *dev)
 {
 	if (device_may_wakeup(dev))
@@ -805,17 +806,15 @@ static int sh_rtc_resume(struct device *dev)
 
 	return 0;
 }
+#endif
 
-static const struct dev_pm_ops sh_rtc_dev_pm_ops = {
-	.suspend = sh_rtc_suspend,
-	.resume = sh_rtc_resume,
-};
+static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume);
 
 static struct platform_driver sh_rtc_platform_driver = {
 	.driver		= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
-		.pm	= &sh_rtc_dev_pm_ops,
+		.pm	= &sh_rtc_pm_ops,
 	},
 	.remove		= __exit_p(sh_rtc_remove),
 };
Signature · 1 line
1.7.2.5
author
#6 lore raw

PATCH 7/10 rtc: rtc-wm8350: switch to using SIMPLE_DEV_PM_OPS

In reply to Jingoo Han

Switch to using SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. It reduces code size.

---
 drivers/rtc/rtc-wm8350.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)
drivers/rtc/rtc-wm8350.c +3 -9
index 8ad86ae..26581ea 100644
@@ -339,7 +339,7 @@ static const struct rtc_class_ops wm8350_rtc_ops = {
 	.alarm_irq_enable = wm8350_rtc_alarm_irq_enable,
 };
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int wm8350_rtc_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -375,10 +375,6 @@ static int wm8350_rtc_resume(struct device *dev)
 
 	return 0;
 }
-
-#else
-#define wm8350_rtc_suspend NULL
-#define wm8350_rtc_resume NULL
 #endif
 
 static int wm8350_rtc_probe(struct platform_device *pdev)
@@ -472,10 +468,8 @@ static int wm8350_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static struct dev_pm_ops wm8350_rtc_pm_ops = {
-	.suspend = wm8350_rtc_suspend,
-	.resume = wm8350_rtc_resume,
-};
+static SIMPLE_DEV_PM_OPS(wm8350_rtc_pm_ops, wm8350_rtc_suspend,
+			wm8350_rtc_resume);
 
 static struct platform_driver wm8350_rtc_driver = {
 	.probe = wm8350_rtc_probe,
Signature · 1 line
1.7.2.5
author
#7 lore raw

PATCH 8/10 rtc: rtc-tps6586x: switch to using SIMPLE_DEV_PM_OPS

In reply to Jingoo Han

Switch to using SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. It reduces code size.

---
 drivers/rtc/rtc-tps6586x.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/rtc/rtc-tps6586x.c +2 -3
index b6aab9f..badfea4 100644
@@ -333,9 +333,8 @@ static int tps6586x_rtc_resume(struct device *dev)
 }
 #endif
 
-static const struct dev_pm_ops tps6586x_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(tps6586x_rtc_suspend, tps6586x_rtc_resume)
-};
+static SIMPLE_DEV_PM_OPS(tps6586x_pm_ops, tps6586x_rtc_suspend,
+			tps6586x_rtc_resume);
 
 static struct platform_driver tps6586x_rtc_driver = {
 	.driver	= {
Signature · 1 line
1.7.2.5
author
#8 lore raw

PATCH 9/10 rtc: rtc-tps65910: switch to using SIMPLE_DEV_PM_OPS

In reply to Jingoo Han

Switch to using SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. It reduces code size.

---
 drivers/rtc/rtc-tps65910.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/rtc/rtc-tps65910.c +2 -3
index ef5d199..26b8bd2 100644
@@ -320,9 +320,8 @@ static int tps65910_rtc_resume(struct device *dev)
 }
 #endif
 
-static const struct dev_pm_ops tps65910_rtc_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(tps65910_rtc_suspend, tps65910_rtc_resume)
-};
+static SIMPLE_DEV_PM_OPS(tps65910_rtc_pm_ops, tps65910_rtc_suspend,
+			tps65910_rtc_resume);
 
 static struct platform_driver tps65910_rtc_driver = {
 	.probe		= tps65910_rtc_probe,
Signature · 1 line
1.7.2.5
author
#9 lore raw

PATCH 10/10 rtc: rtc-tps80031: switch to using SIMPLE_DEV_PM_OPS

In reply to Jingoo Han

Switch to using SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. It reduces code size.

---
 drivers/rtc/rtc-tps80031.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/rtc/rtc-tps80031.c +2 -3
index dc62d5f..72662ea 100644
@@ -323,9 +323,8 @@ static int tps80031_rtc_resume(struct device *dev)
 };
 #endif
 
-static const struct dev_pm_ops tps80031_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(tps80031_rtc_suspend, tps80031_rtc_resume)
-};
+static SIMPLE_DEV_PM_OPS(tps80031_pm_ops, tps80031_rtc_suspend,
+			tps80031_rtc_resume);
 
 static struct platform_driver tps80031_rtc_driver = {
 	.driver	= {
Signature · 1 line
1.7.2.5