Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1298580 > unrolled thread
| Started by | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| First post | 2015-12-28 11:20 +0100 |
| Last post | 2015-12-28 11:20 +0100 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH v2 00/16] clk: a collection of various clean-ups and improvements Masahiro Yamada <yamada.masahiro@socionext.com> - 2015-12-28 11:20 +0100
[PATCH v2 13/16] clk: walk the orphan clock list more simply Masahiro Yamada <yamada.masahiro@socionext.com> - 2015-12-28 11:20 +0100
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| Date | 2015-12-28 11:20 +0100 |
| Subject | [PATCH v2 00/16] clk: a collection of various clean-ups and improvements |
| Message-ID | <qKD4d-sS-5@gated-at.bofh.it> |
Many refactoring, with detection of circular parent looping. Changes in v2: - Fix a bug. Return -EINVAL when parent _is_ NULL. Masahiro Yamada (16): clk: remove unused first argument of __clk_init() clk: change the argument of __clk_init() into pointer to clk_core clk: rename __clk_init() into __clk_core_init() clk: remove unnecessary !core->parents conditional clk: change sizeof(struct clk *) to sizeof(*core->parents) clk: move core->parents allocation to clk_register() clk: simplify clk_core_get_parent_by_index() clk: drop the initial core->parents look-ups from __clk_core_init() clk: replace pr_warn() with pr_err() for fatal cases clk: move checking .git_parent to __clk_core_init() clk: simplify __clk_init_parent() clk: avoid circular clock topology clk: walk the orphan clock list more simply clk: make sure parent is not NULL in clk_fetch_parent_index() clk: simplify clk_fetch_parent_index() function clk: slightly optimize clk_core_set_parent() drivers/clk/clk.c | 214 ++++++++++++++++++++++-------------------------------- 1 file changed, 85 insertions(+), 129 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| Date | 2015-12-28 11:20 +0100 |
| Subject | [PATCH v2 13/16] clk: walk the orphan clock list more simply |
| Message-ID | <qKD4g-sS-49@gated-at.bofh.it> |
| In reply to | #1298580 |
This loop can be much simpler. If a new parent is available for
orphan clocks, __clk_init_parent(orphan) can detect it.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index a4f66fe..efd093a 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2402,24 +2402,15 @@ static int __clk_core_init(struct clk_core *core)
core->rate = core->req_rate = rate;
/*
- * walk the list of orphan clocks and reparent any that are children of
- * this clock
+ * walk the list of orphan clocks and reparent any that newly finds a
+ * parent.
*/
hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list, child_node) {
- if (orphan->num_parents && orphan->ops->get_parent) {
- i = orphan->ops->get_parent(orphan->hw);
- if (i >= 0 && i < orphan->num_parents &&
- !strcmp(core->name, orphan->parent_names[i]))
- clk_core_reparent(orphan, core);
- continue;
- }
+ struct clk_core *parent = __clk_init_parent(orphan);
- for (i = 0; i < orphan->num_parents; i++)
- if (!strcmp(core->name, orphan->parent_names[i])) {
- clk_core_reparent(orphan, core);
- break;
- }
- }
+ if (parent)
+ clk_core_reparent(orphan, parent);
+ }
/*
* optional platform-specific magic
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web