SUPERH platform development
 help / color / mirror / Atom feed
* [PATCH] PM / Domains: Fix build for CONFIG_PM_SLEEP unset
@ 2012-01-10 21:13 Rafael J. Wysocki
  0 siblings, 0 replies; only message in thread
From: Rafael J. Wysocki @ 2012-01-10 21:13 UTC (permalink / raw)
  To: Linux PM list; +Cc: LKML, Magnus Damm, linux-sh

From: Rafael J. Wysocki <rjw@sisk.pl>

Some callback functions defined in drivers/base/power/domain.c are
only necessary if CONFIG_PM_SLEEP and they call some other functions
that are only available in that case.  For this reason, they should
not be compiled at all when CONFIG_PM_SLEEP is not set.

Reported-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/base/power/domain.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

Index: linux/drivers/base/power/domain.c
=================================--- linux.orig/drivers/base/power/domain.c
+++ linux/drivers/base/power/domain.c
@@ -1429,6 +1429,8 @@ static int pm_genpd_default_restore_stat
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+
 /**
  * pm_genpd_default_suspend - Default "device suspend" for PM domians.
  * @dev: Device to handle.
@@ -1517,6 +1519,19 @@ static int pm_genpd_default_thaw(struct
 	return cb ? cb(dev) : pm_generic_thaw(dev);
 }
 
+#else /* !CONFIG_PM_SLEEP */
+
+#define pm_genpd_default_suspend	NULL
+#define pm_genpd_default_suspend_late	NULL
+#define pm_genpd_default_resume_early	NULL
+#define pm_genpd_default_resume		NULL
+#define pm_genpd_default_freeze		NULL
+#define pm_genpd_default_freeze_late	NULL
+#define pm_genpd_default_thaw_early	NULL
+#define pm_genpd_default_thaw		NULL
+
+#endif /* !CONFIG_PM_SLEEP */
+
 /**
  * pm_genpd_init - Initialize a generic I/O PM domain object.
  * @genpd: PM domain object to initialize.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-01-10 21:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-10 21:13 [PATCH] PM / Domains: Fix build for CONFIG_PM_SLEEP unset Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox