diff options
author | Rob Herring <robh@kernel.org> | 2014-05-12 12:24:31 -0400 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2014-05-20 15:25:22 -0400 |
commit | cb7d5f425fd1c5f2295770c3ee36c950a0b6714b (patch) | |
tree | b5e0260255c770c68f25f459b0577a78821530a2 | |
parent | 5c46f43f08004d6d25772c9b6e24fa048c8c3efc (diff) |
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: Rob Herring <robh@kernel.org>
Cc: "Emilio López" <emilio@elopez.com.ar>
Acked-by: Mike Turquette <mturquette@linaro.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
-rw-r--r-- | drivers/clk/sunxi/clk-sunxi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index bd7dc733c1ca..ef5e2d8096d8 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c | |||
@@ -1278,8 +1278,7 @@ static void __init of_sunxi_table_clock_setup(const struct of_device_id *clk_mat | |||
1278 | const struct of_device_id *match; | 1278 | const struct of_device_id *match; |
1279 | void (*setup_function)(struct device_node *, const void *) = function; | 1279 | void (*setup_function)(struct device_node *, const void *) = function; |
1280 | 1280 | ||
1281 | for_each_matching_node(np, clk_match) { | 1281 | for_each_matching_node_and_match(np, clk_match, &match) { |
1282 | match = of_match_node(clk_match, np); | ||
1283 | data = match->data; | 1282 | data = match->data; |
1284 | setup_function(np, data); | 1283 | setup_function(np, data); |
1285 | } | 1284 | } |