@@ -970,11 +970,12 @@ static const struct of_device_id l2x0_ids[] __initconst = {
int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
{
+ const struct of_device_id *match;
struct device_node *np;
const struct l2x0_of_data *data;
struct resource res;
- np = of_find_matching_node(NULL, l2x0_ids);
+ np = of_find_matching_node_and_match(NULL, l2x0_ids, &match);
if (!np)
return -ENODEV;
@@ -987,7 +988,7 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
l2x0_saved_regs.phy_base = res.start;
- data = of_match_node(l2x0_ids, np)->data;
+ data = match->data;
/* L2 configuration can only be changed if the cache is disabled */
if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) {
Instead of the of_find_matching_node()/of_match_node() pair, which requires two iterations through the match table, make use of of_find_matching_node_and_match(), which only iterates through the table once. Signed-off-by: Josh Cartwright <joshc@codeaurora.org> --- arch/arm/mm/cache-l2x0.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)