summary refs log tree commit diff
path: root/drivers/bus
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2018-02-15 18:51:44 +0000
committerArnd Bergmann <arnd@arndb.de>2018-03-06 17:26:48 +0100
commit3ee5e821f3a1affd406ff1031f4cf6d7b4f81ab3 (patch)
tree1a8893df91968ea0a8aeb67e127dea72bcd6220f /drivers/bus
parent03057f2626e955ebea88a668a6d7d699f836e5c0 (diff)
downloadlinux-3ee5e821f3a1affd406ff1031f4cf6d7b4f81ab3.tar.gz
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: Punit Agrawal <punit.agrawal@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/arm-cci.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index 503c1789dd02..23dc0b890d0c 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -448,13 +448,10 @@ static int cci_probe_ports(struct device_node *np)
 	if (!ports)
 		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))
 			continue;
 
-		if (!of_device_is_available(cp))
-			continue;
-
 		i = nb_ace + nb_ace_lite;
 
 		if (i >= nb_cci_ports)
@@ -534,7 +531,7 @@ static int cci_probe(void)
 	struct resource res;
 
 	np = of_find_matching_node(NULL, arm_cci_matches);
-	if(!np || !of_device_is_available(np))
+	if (!of_device_is_available(np))
 		return -ENODEV;
 
 	ret = of_address_to_resource(np, 0, &res);