Thread (58 messages) flat view 58 messages, 11 authors, 2014-07-08
STALE4417d

[PATCH v4 2/8] clk: samsung: change scope of samsung clock lock to global

From: Thomas Abraham <hidden>
Date: 2014-05-14 01:11:10
Also in: linux-arm-kernel, linux-samsung-soc
Subsystem: common clk framework, samsung soc clock drivers, the rest · Maintainers: Michael Turquette, Stephen Boyd, Krzysztof Kozlowski, Sylwester Nawrocki, Chanwoo Choi, Peter Griffin, Linus Torvalds

From: Thomas Abraham <redacted>

Access to samsung clock lock is required to support newer samsung specific
clock types. So change the scope of the samsung clock lock to global. And
prefix 'samsung_clk_' to the existing name of the lock to prevent name space
pollution.

Cc: Tomasz Figa <redacted>
Signed-off-by: Thomas Abraham <redacted>
---
 drivers/clk/samsung/clk.c |   13 ++++++++-----
 drivers/clk/samsung/clk.h |    2 ++
 2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c
index 91bec3e..c86c28c 100644
--- a/drivers/clk/samsung/clk.c
+++ b/drivers/clk/samsung/clk.c
@@ -14,7 +14,7 @@
 #include <linux/syscore_ops.h>
 #include "clk.h"
 
-static DEFINE_SPINLOCK(lock);
+DEFINE_SPINLOCK(samsung_clk_lock);
 static struct clk **clk_table;
 static void __iomem *reg_base;
 #ifdef CONFIG_OF
@@ -173,7 +173,8 @@ void __init samsung_clk_register_mux(struct samsung_mux_clock *list,
 	for (idx = 0; idx < nr_clk; idx++, list++) {
 		clk = clk_register_mux(NULL, list->name, list->parent_names,
 			list->num_parents, list->flags, reg_base + list->offset,
-			list->shift, list->width, list->mux_flags, &lock);
+			list->shift, list->width, list->mux_flags,
+			&samsung_clk_lock);
 		if (IS_ERR(clk)) {
 			pr_err("%s: failed to register clock %s\n", __func__,
 				list->name);
@@ -206,12 +207,13 @@ void __init samsung_clk_register_div(struct samsung_div_clock *list,
 					list->parent_name, list->flags,
 					reg_base + list->offset, list->shift,
 					list->width, list->div_flags,
-					list->table, &lock);
+					list->table, &samsung_clk_lock);
 		else
 			clk = clk_register_divider(NULL, list->name,
 					list->parent_name, list->flags,
 					reg_base + list->offset, list->shift,
-					list->width, list->div_flags, &lock);
+					list->width, list->div_flags,
+					&samsung_clk_lock);
 		if (IS_ERR(clk)) {
 			pr_err("%s: failed to register clock %s\n", __func__,
 				list->name);
@@ -241,7 +243,8 @@ void __init samsung_clk_register_gate(struct samsung_gate_clock *list,
 	for (idx = 0; idx < nr_clk; idx++, list++) {
 		clk = clk_register_gate(NULL, list->name, list->parent_name,
 				list->flags, reg_base + list->offset,
-				list->bit_idx, list->gate_flags, &lock);
+				list->bit_idx, list->gate_flags,
+				&samsung_clk_lock);
 		if (IS_ERR(clk)) {
 			pr_err("%s: failed to register clock %s\n", __func__,
 				list->name);
diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h
index c7141ba..951bc85 100644
--- a/drivers/clk/samsung/clk.h
+++ b/drivers/clk/samsung/clk.h
@@ -21,6 +21,8 @@
 #include <linux/of_address.h>
 #include "clk-pll.h"
 
+extern spinlock_t samsung_clk_lock;
+
 /**
  * struct samsung_clock_alias: information about mux clock
  * @id: platform specific id of the clock.
-- 
1.7.4.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help