summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-01-28 18:42:10 -0500
committerTom Rini <trini@konsulko.com>2016-01-28 18:42:10 -0500
commit82d72a1b9967cff4908f22c57536c3660f794401 (patch)
treeed7f02df10ffa0f7c4ef87298c1c5e5f4be5dd45 /arch
parent3faf2216d9649e2a22e6728194e9797cb46db933 (diff)
parentb2b7fbc33ff1b990804e481153dd45de579cff75 (diff)
downloadu-boot-imx-82d72a1b9967cff4908f22c57536c3660f794401.zip
u-boot-imx-82d72a1b9967cff4908f22c57536c3660f794401.tar.gz
u-boot-imx-82d72a1b9967cff4908f22c57536c3660f794401.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-net
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv7/ls102xa/fdt.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/arm/cpu/armv7/ls102xa/fdt.c b/arch/arm/cpu/armv7/ls102xa/fdt.c
index 856abed..ae5e794 100644
--- a/arch/arm/cpu/armv7/ls102xa/fdt.c
+++ b/arch/arm/cpu/armv7/ls102xa/fdt.c
@@ -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;
}