All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: Provide notifier stubs when !COMMON_CLK
@ 2016-06-28  6:20 Krzysztof Kozlowski
  0 siblings, 0 replies; only message in thread
From: Krzysztof Kozlowski @ 2016-06-28  6:20 UTC (permalink / raw)
  To: Russell King, linux-clk, linux-kernel, Michael Turquette,
	Stephen Boyd, MyungJoo Ham, Kyungmin Park, linux-pm
  Cc: Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz

The clk notifier symbols are hidden by COMMON_CLK.  However on some
platforms HAVE_CLK might be set while COMMON_CLK not which leads to
compile test build errors like:

$ make.cross ARCH=sh
   drivers/devfreq/tegra-devfreq.c: In function 'tegra_actmon_rate_notify_cb':
>> drivers/devfreq/tegra-devfreq.c:391:16: error: 'POST_RATE_CHANGE' undeclared (first use in this function)
     if (action != POST_RATE_CHANGE)
                   ^
   drivers/devfreq/tegra-devfreq.c: In function 'tegra_devfreq_probe':
>> drivers/devfreq/tegra-devfreq.c:654:8: error: implicit declaration of function 'clk_notifier_register' [-Werror=implicit-function-declaration]
     err = clk_notifier_register(tegra->emc_clock, &tegra->rate_change_nb);
           ^

Export the macros and data type declarations outside of COMMON_CLK ifdef
and provide stubs to fix the compile testing.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

---

Reported when testing patch [1] on ARCH=sh. I don't have the sh cross
compile toolchain so I cannot verify whether this fixes reported issue.

[1] http://www.gossamer-threads.com/lists/linux/kernel/2471798
---
 include/linux/clk.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/include/linux/clk.h b/include/linux/clk.h
index 834179f3fa72..c83b8a9ffc14 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -20,8 +20,6 @@ struct device;
 
 struct clk;
 
-#ifdef CONFIG_COMMON_CLK
-
 /**
  * DOC: clk notifier callback types
  *
@@ -61,6 +59,8 @@ struct clk_notifier {
 	struct list_head		node;
 };
 
+#ifdef CONFIG_COMMON_CLK
+
 /**
  * struct clk_notifier_data - rate data to pass to the notifier callback
  * @clk: struct clk * being changed
@@ -140,6 +140,18 @@ bool clk_is_match(const struct clk *p, const struct clk *q);
 
 #else
 
+static inline int clk_notifier_register(struct clk *clk,
+					struct notifier_block *nb)
+{
+	return -ENOTSUPP;
+}
+
+static inline int clk_notifier_unregister(struct clk *clk,
+					  struct notifier_block *nb)
+{
+	return -ENOTSUPP;
+}
+
 static inline long clk_get_accuracy(struct clk *clk)
 {
 	return -ENOTSUPP;
-- 
1.9.1

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

only message in thread, other threads:[~2016-06-28  6:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-28  6:20 [PATCH] clk: Provide notifier stubs when !COMMON_CLK Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.