blob: aa3dee1994f8340b86c18f77d6634a2b00eb5766 [file] [log] [blame]
From 3d9527abc39b9a22e9883b6b9cc27f074bfe8254 Mon Sep 17 00:00:00 2001
From: Martin Blumenstingl <>
Date: Fri, 3 Apr 2020 22:51:33 +0200
Subject: [PATCH] thermal: devfreq_cooling: inline all stubs for
commit 3f5b9959041e0db6dacbea80bb833bff5900999f upstream.
When CONFIG_DEVFREQ_THERMAL is disabled all functions except
of_devfreq_cooling_register_power() were already inlined. Also inline
the last function to avoid compile errors when multiple drivers call
of_devfreq_cooling_register_power() when CONFIG_DEVFREQ_THERMAL is not
set. Compilation failed with the following message:
multiple definition of `of_devfreq_cooling_register_power'
(which then lists all usages of of_devfreq_cooling_register_power())
Thomas Zimmermann reported this problem [0] on a kernel config with
CONFIG_DEVFREQ_THERMAL=n after both, the lima and panfrost drivers
gained devfreq cooling support.
Fixes: a76caf55e5b356 ("thermal: Add devfreq cooling")
Reported-by: Thomas Zimmermann <>
Signed-off-by: Martin Blumenstingl <>
Tested-by: Thomas Zimmermann <>
Signed-off-by: Daniel Lezcano <>
Signed-off-by: Paul Gortmaker <>
diff --git a/include/linux/devfreq_cooling.h b/include/linux/devfreq_cooling.h
index 4635f95000a4..79a6e37a1d6f 100644
--- a/include/linux/devfreq_cooling.h
+++ b/include/linux/devfreq_cooling.h
@@ -75,7 +75,7 @@ void devfreq_cooling_unregister(struct thermal_cooling_device *dfc);
-struct thermal_cooling_device *
+static inline struct thermal_cooling_device *
of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
struct devfreq_cooling_power *dfc_power)