2016-05-23 09:20:20 +00:00
|
|
|
From b9f9b937dd12dc57bd54a6c89b18eb40d4508424 Mon Sep 17 00:00:00 2001
|
2016-03-22 21:14:51 +00:00
|
|
|
From: Dan Carpenter <dan.carpenter@oracle.com>
|
|
|
|
Date: Tue, 15 Mar 2016 10:18:49 +0300
|
2016-05-23 09:20:20 +00:00
|
|
|
Subject: [PATCH 057/102] net: mediatek: checking for IS_ERR() instead of NULL
|
2016-03-22 21:14:51 +00:00
|
|
|
|
|
|
|
of_phy_connect() returns NULL on error, it never returns error pointers.
|
|
|
|
|
|
|
|
Fixes: 656e705243fd ('net-next: mediatek: add support for MT7623 ethernet')
|
|
|
|
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
|
|
|
|
---
|
|
|
|
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++--
|
|
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
|
2016-05-23 09:20:20 +00:00
|
|
|
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
|
|
index ba3afa5..9759fe5 100644
|
2016-03-22 21:14:51 +00:00
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -186,9 +186,9 @@ static int mtk_phy_connect_node(struct mtk_eth *eth, struct mtk_mac *mac,
|
2016-03-22 21:14:51 +00:00
|
|
|
|
|
|
|
phydev = of_phy_connect(eth->netdev[mac->id], phy_node,
|
|
|
|
mtk_phy_link_adjust, 0, phy_mode);
|
|
|
|
- if (IS_ERR(phydev)) {
|
|
|
|
+ if (!phydev) {
|
|
|
|
dev_err(eth->dev, "could not connect to PHY\n");
|
|
|
|
- return PTR_ERR(phydev);
|
|
|
|
+ return -ENODEV;
|
|
|
|
}
|
|
|
|
|
|
|
|
dev_info(eth->dev,
|
2016-05-23 09:20:20 +00:00
|
|
|
--
|
|
|
|
1.7.10.4
|
|
|
|
|