mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PM / Domains: avoid unused function warning
@ 2017-06-30 16:09 Arnd Bergmann
  0 siblings, 0 replies; only message in thread
From: Arnd Bergmann @ 2017-06-30 16:09 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Arnd Bergmann, Kevin Hilman, Ulf Hansson, Pavel Machek,
	Len Brown, Greg Kroah-Hartman, Jon Hunter, Lina Iyer,
	Krzysztof Kozlowski, Mikko Perttunen, linux-pm, linux-kernel

The only caller of pm_genpd_present outside of CONFIG_PM_GENERIC_DOMAINS_OF
was removed, so we now get a warning when that is disabled:

drivers/base/power/domain.c:725:13: error: 'pm_genpd_present' defined but not used [-Werror=unused-function]

This moves the function definition inside of the #ifdef section.

Fixes: 8b55e55ee443 ("PM / Domains: Handle safely genpd_syscore_switch() call on non-genpd device")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/base/power/domain.c | 40 ++++++++++++++++++----------------------
 1 file changed, 18 insertions(+), 22 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 7eca0f0cbc3b..a380d9d61335 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -716,28 +716,6 @@ static int __init genpd_power_off_unused(void)
 }
 late_initcall(genpd_power_off_unused);
 
-#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_GENERIC_DOMAINS_OF)
-
-/**
- * pm_genpd_present - Check if the given PM domain has been initialized.
- * @genpd: PM domain to check.
- */
-static bool pm_genpd_present(const struct generic_pm_domain *genpd)
-{
-	const struct generic_pm_domain *gpd;
-
-	if (IS_ERR_OR_NULL(genpd))
-		return false;
-
-	list_for_each_entry(gpd, &gpd_list, gpd_list_node)
-		if (gpd == genpd)
-			return true;
-
-	return false;
-}
-
-#endif
-
 #ifdef CONFIG_PM_SLEEP
 
 static bool genpd_dev_active_wakeup(const struct generic_pm_domain *genpd,
@@ -1675,6 +1653,24 @@ static LIST_HEAD(of_genpd_providers);
 static DEFINE_MUTEX(of_genpd_mutex);
 
 /**
+ * pm_genpd_present - Check if the given PM domain has been initialized.
+ * @genpd: PM domain to check.
+ */
+static bool pm_genpd_present(const struct generic_pm_domain *genpd)
+{
+	const struct generic_pm_domain *gpd;
+
+	if (IS_ERR_OR_NULL(genpd))
+		return false;
+
+	list_for_each_entry(gpd, &gpd_list, gpd_list_node)
+		if (gpd == genpd)
+			return true;
+
+	return false;
+}
+
+/**
  * genpd_xlate_simple() - Xlate function for direct node-domain mapping
  * @genpdspec: OF phandle args to map into a PM domain
  * @data: xlate function private data - pointer to struct generic_pm_domain
-- 
2.9.0

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

only message in thread, other threads:[~2017-06-30 16:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30 16:09 [PATCH] PM / Domains: avoid unused function warning Arnd Bergmann

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

all inboxes | Powered by JetHome®