Skip to contentSkip to conversation

usb: musb: am35x: use SIMPLE_DEV_PM_OPS

PATCH New Daniel Mack 3 participants 6 messages Sep 22, 2013 3 messages not in the archive

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

PATCH v2 1/4 usb: musb: am35x: use SIMPLE_DEV_PM_OPS

This makes am35x_pm_ops const and will stub the struct out in case CONFIG_PM_SLEEP is not set.

---

I'm resending this series because I've just learned that SIMPLE_DEV_PM_OPS will stub itself out in case CONFIG_PM_SLEEP is not set. That makes the the code even smaller.

 drivers/usb/musb/am35x.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/usb/musb/am35x.c +3 -10
index 5c310c6..7f1e990 100644
@@ -615,23 +615,16 @@ static int am35x_resume(struct device *dev)
 
 	return 0;
 }
-
-static struct dev_pm_ops am35x_pm_ops = {
-	.suspend	= am35x_suspend,
-	.resume		= am35x_resume,
-};
-
-#define DEV_PM_OPS	&am35x_pm_ops
-#else
-#define DEV_PM_OPS	NULL
 #endif
 
+static SIMPLE_DEV_PM_OPS(am35x_pm_ops, am35x_suspend, am35x_resume);
+
 static struct platform_driver am35x_driver = {
 	.probe		= am35x_probe,
 	.remove		= am35x_remove,
 	.driver		= {
 		.name	= "musb-am35x",
-		.pm	= DEV_PM_OPS,
+		.pm	= &am35x_pm_ops,
 	},
 };
 
Signature · 1 line
1.8.3.1

A message that is not in the archive (sent off-list or not yet received): 1379860999-7106-1-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH v2 2/4 usb: musb: blackfin: use SIMPLE_DEV_PM_OPS

This makes bfin_pm_ops const and will stub the struct out in case CONFIG_PM_SLEEP is not set.

---
 drivers/usb/musb/blackfin.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/usb/musb/blackfin.c +0 -5
index 72e2056..d9692f7 100644
@@ -561,23 +561,16 @@ static int bfin_resume(struct device *dev)
 
 	return 0;
 }
-
-static struct dev_pm_ops bfin_pm_ops = {
-	.suspend	= bfin_suspend,
-	.resume		= bfin_resume,
-};
#3 lore raw

PATCH v2 3/4 usb: musb: omap2430: use SIMPLE_DEV_PM_OPS

In reply to a message not in the archive

This makes omap2430_pm_ops const and will stub the struct out in case CONFIG_PM_SLEEP is not set.

---
 drivers/usb/musb/omap2430.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/usb/musb/omap2430.c +0 -5
index 59d2245..be42460 100644
@@ -659,17 +659,12 @@ static int omap2430_runtime_resume(struct device *dev)
 
 	return 0;
 }
-
-static struct dev_pm_ops omap2430_pm_ops = {
-	.runtime_suspend = omap2430_runtime_suspend,
-	.runtime_resume = omap2430_runtime_resume,
-};

A message that is not in the archive (sent off-list or not yet received): 1379860999-7106-3-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#5 lore raw

Re: [PATCH v2 3/4] usb: musb: omap2430: use SIMPLE_DEV_PM_OPS

Hello.

Quoted 20 lines · Daniel Mack

This makes omap2430_pm_ops const and will stub the struct out in case CONFIG_PM_SLEEP is not set.

---
  drivers/usb/musb/omap2430.c | 15 +++++----------
  1 file changed, 5 insertions(+), 10 deletions(-)
drivers/usb/musb/omap2430.c +0 -4
index 59d2245..be42460 100644
@@ -659,17 +659,12 @@ static int omap2430_runtime_resume(struct device *dev)
 
  	return 0;
  }
-
-static struct dev_pm_ops omap2430_pm_ops = {
-	.runtime_suspend = omap2430_runtime_suspend,
-	.runtime_resume = omap2430_runtime_resume,

drivers/usb/musb/omap2430.c static int omap2430_runtime_resume(struct device *dev) · line 666

Quoted 10 lines
drivers/usb/musb/omap2430.c +3 -5
-};
-
-#define DEV_PM_OPS	(&omap2430_pm_ops)
-#else
-#define DEV_PM_OPS	NULL
  #endif
 
+static SIMPLE_DEV_PM_OPS(omap2430_pm_ops,
+			 omap2430_runtime_suspend,
+			 omap2430_runtime_resume);

No, SIMPLE_DEV_PM_OPS() won't do here, it's runtime PM, didn't you see?

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 523F05C4.50104-M4DtvfQ/[email protected]

#7 lore raw

Re: [PATCH v2 3/4] usb: musb: omap2430: use SIMPLE_DEV_PM_OPS

Quoted 29 lines · Sergei Shtylyov
Quoted 27 lines · Daniel Mack

This makes omap2430_pm_ops const and will stub the struct out in case CONFIG_PM_SLEEP is not set.

---
  drivers/usb/musb/omap2430.c | 15 +++++----------
  1 file changed, 5 insertions(+), 10 deletions(-)
drivers/usb/musb/omap2430.c +0 -9
index 59d2245..be42460 100644
@@ -659,17 +659,12 @@ static int omap2430_runtime_resume(struct device *dev)
 
  	return 0;
  }
-
-static struct dev_pm_ops omap2430_pm_ops = {
-	.runtime_suspend = omap2430_runtime_suspend,
-	.runtime_resume = omap2430_runtime_resume,
-};
-
-#define DEV_PM_OPS	(&omap2430_pm_ops)
-#else
-#define DEV_PM_OPS	NULL
  #endif
 
Quoted 5 lines

drivers/usb/musb/omap2430.c static int omap2430_runtime_resume(struct device *dev) · line 666

Quoted 3 lines
drivers/usb/musb/omap2430.c +3 -0
+static SIMPLE_DEV_PM_OPS(omap2430_pm_ops,
+			 omap2430_runtime_suspend,
+			 omap2430_runtime_resume);

No, SIMPLE_DEV_PM_OPS() won't do here, it's runtime PM, didn't you see?

Eh, you're right, sorry. Whoever applies this series, just drop that one patch. The rest of this series is not affected.

Sergei, thanks for the review again :)

Daniel

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw

PATCH v2 4/4 usb: musb: ux500: use SIMPLE_DEV_PM_OPS

In reply to a message not in the archive

This removes the DEV_PM_OPS macro and brings this file in line with the other musb platform drivers.

---
 drivers/usb/musb/ux500.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/usb/musb/ux500.c +0 -5
index 59256b1..f483d19 100644
@@ -376,17 +376,10 @@ static int ux500_resume(struct device *dev)
 
 	return 0;
 }
-
-static const struct dev_pm_ops ux500_pm_ops = {
-	.suspend	= ux500_suspend,
-	.resume		= ux500_resume,
-};