net: ll_temac: Fix an NULL vs IS_ERR() check in temac_open()
Subsystems (5)
PATCH 1/2 net: ll_temac: Fix an NULL vs IS_ERR() check in temac_open()
The phy_connect() function doesn't return NULL pointers. It returns error pointers on error, so I have updated the check.
--- drivers/net/ethernet/xilinx/ll_temac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/xilinx/ll_temac_main.c +2 -2
@@ -927,9 +927,9 @@ static int temac_open(struct net_device *ndev) }else if (strlen (lp->phy_name) >0 ) { phydev =phy_connect (lp->ndev, lp->phy_name, temac_adjust_link, lp->phy_interface); -if (!phydev) { +if (IS_ERR (phydev)) {dev_err (lp->dev,"phy_connect() failed\n" ); -return -ENODEV ; +return PTR_ERR (phydev); }phy_start (phydev); }
Signature · 1 line
2.18.0
PATCH 2/2 net: ll_temac: remove an unnecessary condition
The "pdata->mdio_bus_id" is unsigned so this condition is always true. This patch just removes it.
--- drivers/net/ethernet/xilinx/ll_temac_mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/xilinx/ll_temac_mdio.c +1 -1
@@ -99,7 +99,7 @@ int temac_mdio_setup(struct temac_local *lp, struct platform_device *pdev)of_address_to_resource (np,0 , &res);snprintf (bus->id,MII_BUS_ID_SIZE ,"%.8llx" , (unsigned long long )res.start); - }else if (pdata && pdata->mdio_bus_id >=0 ) { + }else if (pdata) {snprintf (bus->id,MII_BUS_ID_SIZE ,"%.8llx" , pdata->mdio_bus_id); }
Signature · 1 line
2.18.0
Re: [PATCH 2/2 net-next] net: ll_temac: remove an unnecessary condition
From: Dan Carpenter <[email protected]>
Date: Fri, 3 May 2019 15:50:51 +0300
Quoted 4 lines
The "
pdata->mdio_bus_id" is unsigned so this condition is always true. This patch just removes it.Signed-off-by Dan Carpenter <[email protected]>
Applied.
From: Dan Carpenter <[email protected]>
Date: Fri, 3 May 2019 15:50:24 +0300
Quoted 5 lines
The
phy_connect()function doesn't return NULL pointers. It returns error pointers on error, so I have updated the check.Fixes 8425c41d1ef7 ("net: ll_temac: Extend support to non-device-tree platforms")Signed-off-by Dan Carpenter <[email protected]>
Applied.