Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1446284 > unrolled thread
| Started by | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| First post | 2016-07-19 11:30 +0200 |
| Last post | 2016-07-19 11:30 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/5] clk: forbit multiple adding of clock providers and fix false positive EPROBE_DEFER Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-07-19 11:30 +0200
[PATCH 3/5] clk: refactor of_clk_del_provider() Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-07-19 11:30 +0200
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| Date | 2016-07-19 11:30 +0200 |
| Subject | [PATCH 0/5] clk: forbit multiple adding of clock providers and fix false positive EPROBE_DEFER |
| Message-ID | <rWzvH-2e4-3@gated-at.bofh.it> |
I dropped a question mail around 10 days ago,
https://lkml.org/lkml/2016/7/8/627
but I did not get any reply.
At least, nobody stopped me from going with this fix,
so here is the series to fix it.
Masahiro Yamada (5):
clk: add a helper function __of_clk_find_provider()
clk: avoid adding clock provider multiple times for one node
clk: refactor of_clk_del_provider()
clk: fix false positive EPROBE_DEFER of
__of_clk_get_hw_from_provider()
clk: return -EINVAL if clock provider has no .get callback
drivers/clk/clk.c | 77 ++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 51 insertions(+), 26 deletions(-)
--
1.9.1
[toc] | [next] | [standalone]
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| Date | 2016-07-19 11:30 +0200 |
| Subject | [PATCH 3/5] clk: refactor of_clk_del_provider() |
| Message-ID | <rWzvI-2e4-23@gated-at.bofh.it> |
| In reply to | #1446284 |
Now, it is guaranteed that a single node does not appear twice in
the list of OF clock providers. So, of_clk_del_provider() only
needs to free the first occurrence. This can be implemented more
simply with __of_clk_find_provider().
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
drivers/clk/clk.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 7832343..60daf60 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3121,13 +3121,11 @@ void of_clk_del_provider(struct device_node *np)
struct of_clk_provider *cp;
mutex_lock(&of_clk_mutex);
- list_for_each_entry(cp, &of_clk_providers, link) {
- if (cp->node == np) {
- list_del(&cp->link);
- of_node_put(cp->node);
- kfree(cp);
- break;
- }
+ cp = __of_clk_find_provider(np);
+ if (cp) {
+ list_del(&cp->link);
+ of_node_put(cp->node);
+ kfree(cp);
}
mutex_unlock(&of_clk_mutex);
}
--
1.9.1
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web