Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] pmdomains: fix unused variable warning with !PM_GENERIC_DOMAINS_OF
@ 2026-06-11 12:03 Johan Hovold
  2026-06-11 14:07 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Hovold @ 2026-06-11 12:03 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-pm, linux-kernel, Johan Hovold, kernel test robot

The genpd provider bus is really only used when
CONFIG_PM_GENERIC_DOMAINS_OF is enabled, and since the recent deferred
initialisation of domain parent devices, the root device pointer is
otherwise unused.

Fix the unused variable warning by moving the definition of the root
device pointer inside the corresponding ifdef.

Fixes: ea1ca7623281 ("pmdomain: fix early domain registration")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202606111746.kAxaAbwg-lkp@intel.com/
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/pmdomain/core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
index 19eaee1819c8..f60eac6aa2ca 100644
--- a/drivers/pmdomain/core.c
+++ b/drivers/pmdomain/core.c
@@ -32,9 +32,6 @@ static const struct bus_type genpd_provider_bus_type = {
 	.name		= "genpd_provider",
 };
 
-/* The parent for genpd_provider devices. */
-static struct device *genpd_provider_bus;
-
 #define GENPD_RETRY_MAX_MS	250		/* Approximate */
 
 #define GENPD_DEV_CALLBACK(genpd, type, callback, dev)		\
@@ -2566,6 +2563,10 @@ struct of_genpd_provider {
 static LIST_HEAD(of_genpd_providers);
 /* Mutex to protect the list above. */
 static DEFINE_MUTEX(of_genpd_mutex);
+
+/* The parent for genpd_provider devices. */
+static struct device *genpd_provider_bus;
+
 /* Used to prevent registering devices before the bus. */
 static bool genpd_bus_registered;
 
-- 
2.53.0


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

end of thread, other threads:[~2026-06-11 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11 12:03 [PATCH] pmdomains: fix unused variable warning with !PM_GENERIC_DOMAINS_OF Johan Hovold
2026-06-11 14:07 ` Ulf Hansson

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