3d8974e705ac3eb0eb7b502b56e1355aa3abbc0f
[openwrt/staging/chunkeey.git] / target / linux / mediatek / patches-4.4 / 0060-net-mediatek-checking-for-IS_ERR-instead-of-NULL.patch
1 From c657573d75d71076fef8294f9d4f7f9a0e6f7a9e Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@oracle.com>
3 Date: Tue, 15 Mar 2016 10:18:49 +0300
4 Subject: [PATCH 60/81] net: mediatek: checking for IS_ERR() instead of NULL
5
6 of_phy_connect() returns NULL on error, it never returns error pointers.
7
8 Fixes: 656e705243fd ('net-next: mediatek: add support for MT7623 ethernet')
9 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
10 ---
11 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++--
12 1 file changed, 2 insertions(+), 2 deletions(-)
13
14 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
15 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
16 @@ -186,9 +186,9 @@ static int mtk_phy_connect_node(struct m
17
18 phydev = of_phy_connect(eth->netdev[mac->id], phy_node,
19 mtk_phy_link_adjust, 0, phy_mode);
20 - if (IS_ERR(phydev)) {
21 + if (!phydev) {
22 dev_err(eth->dev, "could not connect to PHY\n");
23 - return PTR_ERR(phydev);
24 + return -ENODEV;
25 }
26
27 dev_info(eth->dev,