mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-07 15:21:36 +00:00
fix lockup in mcfmii/mii_discover_phy() in case communication fails
Signed-off-by: Wolfgang Wegner <w.wegner@astro-kom.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
This commit is contained in:
parent
23c34af48f
commit
33f684d6d5
1 changed files with 24 additions and 23 deletions
|
@ -175,7 +175,8 @@ int mii_discover_phy(struct eth_device *dev)
|
||||||
#ifdef ET_DEBUG
|
#ifdef ET_DEBUG
|
||||||
printf("PHY type 0x%x pass %d type\n", phytype, pass);
|
printf("PHY type 0x%x pass %d type\n", phytype, pass);
|
||||||
#endif
|
#endif
|
||||||
if (phytype != 0xffff) {
|
if (phytype == 0xffff)
|
||||||
|
continue;
|
||||||
phyaddr = phyno;
|
phyaddr = phyno;
|
||||||
phytype <<= 16;
|
phytype <<= 16;
|
||||||
phytype |=
|
phytype |=
|
||||||
|
@ -185,7 +186,8 @@ int mii_discover_phy(struct eth_device *dev)
|
||||||
printf("PHY @ 0x%x pass %d\n", phyno, pass);
|
printf("PHY @ 0x%x pass %d\n", phyno, pass);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < (sizeof(phyinfo) / sizeof(phy_info_t)); i++) {
|
for (i = 0; (i < (sizeof(phyinfo) / sizeof(phy_info_t)))
|
||||||
|
&& (phyinfo[i].phyid != 0); i++) {
|
||||||
if (phyinfo[i].phyid == phytype) {
|
if (phyinfo[i].phyid == phytype) {
|
||||||
#ifdef ET_DEBUG
|
#ifdef ET_DEBUG
|
||||||
printf("phyid %x - %s\n",
|
printf("phyid %x - %s\n",
|
||||||
|
@ -209,7 +211,6 @@ int mii_discover_phy(struct eth_device *dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (phyaddr < 0)
|
if (phyaddr < 0)
|
||||||
printf("No PHY device found.\n");
|
printf("No PHY device found.\n");
|
||||||
|
|
Loading…
Add table
Reference in a new issue