]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pmdomain: core: fix unused variable warning with !PM_GENERIC_DOMAINS_OF
authorJohan Hovold <johan@kernel.org>
Thu, 11 Jun 2026 12:03:45 +0000 (14:03 +0200)
committerUlf Hansson <ulfh@kernel.org>
Mon, 15 Jun 2026 19:12:35 +0000 (21:12 +0200)
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: 92b69eff8012 ("pmdomain: core: 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>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
drivers/pmdomain/core.c

index 7796042e3f373c8f8ffed273c34537218acd15b0..842c4169e290677c1c19f53cbc43759e65811f86 100644 (file)
@@ -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;