mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 22:51:37 +00:00
phy: Return correct error code when timeout happens
Return -ETIMEDOUT if timeout happens. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
parent
55259e7cda
commit
ef5e821bd8
2 changed files with 3 additions and 3 deletions
|
@ -103,7 +103,7 @@ static int m88e1011s_config(struct phy_device *phydev)
|
||||||
/* Parse the 88E1011's status register for speed and duplex
|
/* Parse the 88E1011's status register for speed and duplex
|
||||||
* information
|
* information
|
||||||
*/
|
*/
|
||||||
static uint m88e1xxx_parse_status(struct phy_device *phydev)
|
static int m88e1xxx_parse_status(struct phy_device *phydev)
|
||||||
{
|
{
|
||||||
unsigned int speed;
|
unsigned int speed;
|
||||||
unsigned int mii_reg;
|
unsigned int mii_reg;
|
||||||
|
@ -120,7 +120,7 @@ static uint m88e1xxx_parse_status(struct phy_device *phydev)
|
||||||
if (i > PHY_AUTONEGOTIATE_TIMEOUT) {
|
if (i > PHY_AUTONEGOTIATE_TIMEOUT) {
|
||||||
puts(" TIMEOUT !\n");
|
puts(" TIMEOUT !\n");
|
||||||
phydev->link = 0;
|
phydev->link = 0;
|
||||||
break;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((i++ % 1000) == 0)
|
if ((i++ % 1000) == 0)
|
||||||
|
|
|
@ -248,7 +248,7 @@ int genphy_update_link(struct phy_device *phydev)
|
||||||
if (i > PHY_ANEG_TIMEOUT) {
|
if (i > PHY_ANEG_TIMEOUT) {
|
||||||
printf(" TIMEOUT !\n");
|
printf(" TIMEOUT !\n");
|
||||||
phydev->link = 0;
|
phydev->link = 0;
|
||||||
return 0;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctrlc()) {
|
if (ctrlc()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue