[PATCH] netdev: pasemi: fix return value check in pasemi_mac_phy_init()

Subsystems: linux for powerpc (32-bit and 64-bit), networking drivers, the rest

STALE5060d

2 messages, 2 authors, 2012-09-27 · open the first message on its own page

[PATCH] netdev: pasemi: fix return value check in pasemi_mac_phy_init()

From: Wei Yongjun <hidden>
Date: 2012-09-27 05:51:58

From: Wei Yongjun <redacted>

In case of error, the function of_phy_connect() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <redacted>
---
 drivers/net/ethernet/pasemi/pasemi_mac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c
index e559dfa..6fa74d5 100644
--- a/drivers/net/ethernet/pasemi/pasemi_mac.c
+++ b/drivers/net/ethernet/pasemi/pasemi_mac.c
@@ -1101,9 +1101,9 @@ static int pasemi_mac_phy_init(struct net_device *dev)
 	phydev = of_phy_connect(dev, phy_dn, &pasemi_adjust_link, 0,
 				PHY_INTERFACE_MODE_SGMII);
 
-	if (IS_ERR(phydev)) {
+	if (!phydev) {
 		printk(KERN_ERR "%s: Could not attach to phy\n", dev->name);
-		return PTR_ERR(phydev);
+		return -ENODEV;
 	}
 
 	mac->phydev = phydev;

Re: [PATCH] netdev: pasemi: fix return value check in pasemi_mac_phy_init()

From: David Miller <davem@davemloft.net>
Date: 2012-09-27 17:21:15

From: Wei Yongjun <redacted>
Date: Thu, 27 Sep 2012 13:51:58 +0800
From: Wei Yongjun <redacted>

In case of error, the function of_phy_connect() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <redacted>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help