Commit cb7d5f42 authored by Rob Herring's avatar Rob Herring

clk: sunxi: avoid double DT matching

Use for_each_matching_node_and_match instead of for_each_matching_node plus
of_match_node to avoid searching the DT twice for each node.

The sunxi DT scanning code should really be re-worked rather than have
its own private matching infrastructure. It is working around needing a
function pointer and a data pointer for each compatible match.
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Cc: "Emilio López" <emilio@elopez.com.ar>
Acked-by: default avatarMike Turquette <mturquette@linaro.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
parent 5c46f43f
...@@ -1278,8 +1278,7 @@ static void __init of_sunxi_table_clock_setup(const struct of_device_id *clk_mat ...@@ -1278,8 +1278,7 @@ static void __init of_sunxi_table_clock_setup(const struct of_device_id *clk_mat
const struct of_device_id *match; const struct of_device_id *match;
void (*setup_function)(struct device_node *, const void *) = function; void (*setup_function)(struct device_node *, const void *) = function;
for_each_matching_node(np, clk_match) { for_each_matching_node_and_match(np, clk_match, &match) {
match = of_match_node(clk_match, np);
data = match->data; data = match->data;
setup_function(np, data); setup_function(np, data);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment