diff options
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/gpmc.c | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index ed946df5ad8a..6c4da1254f53 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -1520,36 +1520,22 @@ static int gpmc_probe_dt(struct platform_device *pdev) | |||
1520 | return ret; | 1520 | return ret; |
1521 | } | 1521 | } |
1522 | 1522 | ||
1523 | for_each_node_by_name(child, "nand") { | 1523 | for_each_child_of_node(pdev->dev.of_node, child) { |
1524 | ret = gpmc_probe_nand_child(pdev, child); | ||
1525 | if (ret < 0) { | ||
1526 | of_node_put(child); | ||
1527 | return ret; | ||
1528 | } | ||
1529 | } | ||
1530 | 1524 | ||
1531 | for_each_node_by_name(child, "onenand") { | 1525 | if (!child->name) |
1532 | ret = gpmc_probe_onenand_child(pdev, child); | 1526 | continue; |
1533 | if (ret < 0) { | ||
1534 | of_node_put(child); | ||
1535 | return ret; | ||
1536 | } | ||
1537 | } | ||
1538 | 1527 | ||
1539 | for_each_node_by_name(child, "nor") { | 1528 | if (of_node_cmp(child->name, "nand") == 0) |
1540 | ret = gpmc_probe_generic_child(pdev, child); | 1529 | ret = gpmc_probe_nand_child(pdev, child); |
1541 | if (ret < 0) { | 1530 | else if (of_node_cmp(child->name, "onenand") == 0) |
1542 | of_node_put(child); | 1531 | ret = gpmc_probe_onenand_child(pdev, child); |
1543 | return ret; | 1532 | else if (of_node_cmp(child->name, "ethernet") == 0 || |
1544 | } | 1533 | of_node_cmp(child->name, "nor") == 0) |
1545 | } | 1534 | ret = gpmc_probe_generic_child(pdev, child); |
1546 | 1535 | ||
1547 | for_each_node_by_name(child, "ethernet") { | 1536 | if (WARN(ret < 0, "%s: probing gpmc child %s failed\n", |
1548 | ret = gpmc_probe_generic_child(pdev, child); | 1537 | __func__, child->full_name)) |
1549 | if (ret < 0) { | ||
1550 | of_node_put(child); | 1538 | of_node_put(child); |
1551 | return ret; | ||
1552 | } | ||
1553 | } | 1539 | } |
1554 | 1540 | ||
1555 | return 0; | 1541 | return 0; |