Commit 3ee5e821 authored by Robin Murphy's avatar Robin Murphy Committed by Arnd Bergmann

bus/arm-cci: Streamline devicetree handling a bit

Rather than iterating over child nodes explicitly testing for
availability, we can just use the other helper which already subsumes
that check. Also, the availability check is already NULL-safe, so get
rid of a redundant check in cci_probe(), too.
Acked-by: default avatarPunit Agrawal <punit.agrawal@arm.com>
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 03057f26
...@@ -448,13 +448,10 @@ static int cci_probe_ports(struct device_node *np) ...@@ -448,13 +448,10 @@ static int cci_probe_ports(struct device_node *np)
if (!ports) if (!ports)
return -ENOMEM; return -ENOMEM;
for_each_child_of_node(np, cp) { for_each_available_child_of_node(np, cp) {
if (!of_match_node(arm_cci_ctrl_if_matches, cp)) if (!of_match_node(arm_cci_ctrl_if_matches, cp))
continue; continue;
if (!of_device_is_available(cp))
continue;
i = nb_ace + nb_ace_lite; i = nb_ace + nb_ace_lite;
if (i >= nb_cci_ports) if (i >= nb_cci_ports)
...@@ -534,7 +531,7 @@ static int cci_probe(void) ...@@ -534,7 +531,7 @@ static int cci_probe(void)
struct resource res; struct resource res;
np = of_find_matching_node(NULL, arm_cci_matches); np = of_find_matching_node(NULL, arm_cci_matches);
if(!np || !of_device_is_available(np)) if (!of_device_is_available(np))
return -ENODEV; return -ENODEV;
ret = of_address_to_resource(np, 0, &res); ret = of_address_to_resource(np, 0, &res);
......
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