Skip to contentSkip to conversation

net: ixp4xx_eth: Return proper error for eth_init_one

PATCH In review Axel Lin 3 participants 3 messages Jan 5, 2011 – Jan 6, 2011

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 net: ixp4xx_eth: Return proper error for eth_init_one

Return PTR_ERR(port->phydev) instead of 1 if phy_connect failed.

---
 drivers/net/arm/ixp4xx_eth.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/arm/ixp4xx_eth.c +3 -1
index 6028226..9eb9b98 100644
@@ -1229,8 +1229,10 @@ static int __devinit eth_init_one(struct platform_device *pdev)
 	snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy);
 	port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0,
 				   PHY_INTERFACE_MODE_MII);
-	if ((err = IS_ERR(port->phydev)))
+	if (IS_ERR(port->phydev)) {
+		err = PTR_ERR(port->phydev);
 		goto err_free_mem;
+	}
 
 	port->phydev->irq = PHY_POLL;
 
Signature · 1 line
1.7.2
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Axel Lin

Return PTR_ERR(port->phydev) instead of 1 if phy_connect failed.

drivers/net/arm/ixp4xx_eth.c static int __devinit eth_init_one(struct platform_device *pdev) · line 1237

Quoted 10 lines
drivers/net/arm/ixp4xx_eth.c +3 -1
@@ -1229,8 +1229,10 @@ static int __devinit eth_init_one(struct platform_device *pdev)
 	snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy);
 	port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0,
 				   PHY_INTERFACE_MODE_MII);
-	if ((err = IS_ERR(port->phydev)))
+	if (IS_ERR(port->phydev)) {
+		err = PTR_ERR(port->phydev);
 		goto err_free_mem;
+	}
 
 	port->phydev->irq = PHY_POLL;

Right. Thanks.

Signature · 1 line
Krzysztof Halasa
maintainer
#2 lore raw

From: Krzysztof Halasa <[email protected]>
Date: Wed, 05 Jan 2011 18:43:22 +0100

Quoted 18 lines
Quoted 16 lines · Axel Lin

Return PTR_ERR(port->phydev) instead of 1 if phy_connect failed.

drivers/net/arm/ixp4xx_eth.c +3 -1
@@ -1229,8 +1229,10 @@ static int __devinit eth_init_one(struct platform_device *pdev)
 	snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy);
 	port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0,
 				   PHY_INTERFACE_MODE_MII);
-	if ((err = IS_ERR(port->phydev)))
+	if (IS_ERR(port->phydev)) {
+		err = PTR_ERR(port->phydev);
 		goto err_free_mem;
+	}
 
Quoted 5 lines

drivers/net/arm/ixp4xx_eth.c static int __devinit eth_init_one(struct platform_device *pdev) · line 1237

Quoted 1 line
drivers/net/arm/ixp4xx_eth.c +0 -0
 	port->phydev->irq = PHY_POLL;

Right. Thanks.

I'll apply this, thanks.