Skip to content

Commit

Permalink
clk: sunxi: avoid double DT matching
Browse files Browse the repository at this point in the history
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: Rob Herring <[email protected]>
Cc: "Emilio López" <[email protected]>
Acked-by: Mike Turquette <[email protected]>
Cc: Maxime Ripard <[email protected]>
  • Loading branch information
robherring committed May 20, 2014
1 parent 5c46f43 commit cb7d5f4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/clk/sunxi/clk-sunxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
void (*setup_function)(struct device_node *, const void *) = function;

for_each_matching_node(np, clk_match) {
match = of_match_node(clk_match, np);
for_each_matching_node_and_match(np, clk_match, &match) {
data = match->data;
setup_function(np, data);
}
Expand Down

0 comments on commit cb7d5f4

Please sign in to comment.