Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Robin Murphy and committed by
Arnd Bergmann
3ee5e821 03057f26

+2 -5
+2 -5
drivers/bus/arm-cci.c
··· 448 448 if (!ports) 449 449 return -ENOMEM; 450 450 451 - for_each_child_of_node(np, cp) { 451 + for_each_available_child_of_node(np, cp) { 452 452 if (!of_match_node(arm_cci_ctrl_if_matches, cp)) 453 - continue; 454 - 455 - if (!of_device_is_available(cp)) 456 453 continue; 457 454 458 455 i = nb_ace + nb_ace_lite; ··· 531 534 struct resource res; 532 535 533 536 np = of_find_matching_node(NULL, arm_cci_matches); 534 - if(!np || !of_device_is_available(np)) 537 + if (!of_device_is_available(np)) 535 538 return -ENODEV; 536 539 537 540 ret = of_address_to_resource(np, 0, &res);