Commit 9d4ba117 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Rob Herring (Arm)
Browse files

ARM: at91: Simplify with scoped for each OF child loop

parent 620097c6
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -982,16 +982,13 @@ static void __init at91_pm_sram_init(void)
	struct gen_pool *sram_pool;
	phys_addr_t sram_pbase;
	unsigned long sram_base;
	struct device_node *node;
	struct platform_device *pdev = NULL;

	for_each_compatible_node(node, NULL, "mmio-sram") {
	for_each_compatible_node_scoped(node, NULL, "mmio-sram") {
		pdev = of_find_device_by_node(node);
		if (pdev) {
			of_node_put(node);
		if (pdev)
			break;
	}
	}

	if (!pdev) {
		pr_warn("%s: failed to find sram device!\n", __func__);