linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/4] usb: musb: am35x: use SIMPLE_DEV_PM_OPS
@ 2013-09-22 14:43 Daniel Mack
       [not found] ` <1379860999-7106-1-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Mack @ 2013-09-22 14:43 UTC (permalink / raw)
  To: linux-usb; +Cc: balbi, linux-omap, gregkh, Daniel Mack

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

Signed-off-by: Daniel Mack <zonque@gmail.com>
---

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(-)

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 5c310c6..7f1e990 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -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,
 	},
 };
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-22 15:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-22 14:43 [PATCH v2 1/4] usb: musb: am35x: use SIMPLE_DEV_PM_OPS Daniel Mack
     [not found] ` <1379860999-7106-1-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-22 14:43   ` [PATCH v2 2/4] usb: musb: blackfin: " Daniel Mack
2013-09-22 14:43   ` [PATCH v2 3/4] usb: musb: omap2430: " Daniel Mack
     [not found]     ` <1379860999-7106-3-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-22 14:59       ` Sergei Shtylyov
     [not found]         ` <523F05C4.50104-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2013-09-22 15:02           ` Daniel Mack
2013-09-22 14:43   ` [PATCH v2 4/4] usb: musb: ux500: " Daniel Mack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).