]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/armv7/ls102xa/fdt.c
Merge branch 'master' of git://git.denx.de/u-boot
[u-boot] / arch / arm / cpu / armv7 / ls102xa / fdt.c
index 856abed94182ce741643a40bbe286bf613f97977..d21ad39f8adc4b9a27831d7a343af416f1738f17 100644 (file)
@@ -30,17 +30,13 @@ void ft_fixup_enet_phy_connect_type(void *fdt)
        int phy_node;
        int i = 0;
        uint32_t ph;
+       char *name[3] = { "eTSEC1", "eTSEC2", "eTSEC3" };
 
-       while ((dev = eth_get_dev_by_index(i++)) != NULL) {
-               if (strstr(dev->name, "eTSEC1")) {
-                       strcpy(enet, "ethernet0");
-                       strcpy(phy, "enet0_rgmii_phy");
-               } else if (strstr(dev->name, "eTSEC2")) {
-                       strcpy(enet, "ethernet1");
-                       strcpy(phy, "enet1_rgmii_phy");
-               } else if (strstr(dev->name, "eTSEC3")) {
-                       strcpy(enet, "ethernet2");
-                       strcpy(phy, "enet2_rgmii_phy");
+       for (; i < ARRAY_SIZE(name); i++) {
+               dev = eth_get_dev_by_name(name[i]);
+               if (dev) {
+                       sprintf(enet, "ethernet%d", i);
+                       sprintf(phy, "enet%d_rgmii_phy", i);
                } else {
                        continue;
                }
@@ -98,8 +94,6 @@ void ft_cpu_setup(void *blob, bd_t *bd)
        }
 #endif
 
-       fdt_fixup_ethernet(blob);
-
        off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
        while (off != -FDT_ERR_NOTFOUND) {
                val = gd->cpu_clk;