* [PATCH 1/2 net-next] net: ll_temac: Fix an NULL vs IS_ERR() check in temac_open()
@ 2019-05-03 12:50 Dan Carpenter
2019-05-03 12:50 ` [PATCH 2/2 net-next] net: ll_temac: remove an unnecessary condition Dan Carpenter
2019-05-05 17:29 ` [PATCH 1/2 net-next] net: ll_temac: Fix an NULL vs IS_ERR() check in temac_open() David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2019-05-03 12:50 UTC (permalink / raw)
To: David S. Miller, Esben Haabendal
Cc: Michal Simek, Andrew Lunn, Yang Wei, YueHaibing, Luis Chamberlain,
netdev, kernel-janitors
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 <dan.carpenter@oracle.com>
---
drivers/net/ethernet/xilinx/ll_temac_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 1003ee14c833..bcb97fbf5b54 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -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);
}
--
2.18.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2 net-next] net: ll_temac: remove an unnecessary condition
2019-05-03 12:50 [PATCH 1/2 net-next] net: ll_temac: Fix an NULL vs IS_ERR() check in temac_open() Dan Carpenter
@ 2019-05-03 12:50 ` Dan Carpenter
2019-05-05 17:29 ` David Miller
2019-05-05 17:29 ` [PATCH 1/2 net-next] net: ll_temac: Fix an NULL vs IS_ERR() check in temac_open() David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2019-05-03 12:50 UTC (permalink / raw)
To: David S. Miller, Esben Haabendal
Cc: Michal Simek, Andrew Lunn, netdev, kernel-janitors
The "pdata->mdio_bus_id" is unsigned so this condition is always true.
This patch just removes it.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/net/ethernet/xilinx/ll_temac_mdio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/xilinx/ll_temac_mdio.c b/drivers/net/ethernet/xilinx/ll_temac_mdio.c
index c2a11703bc6d..a4667326f745 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_mdio.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_mdio.c
@@ -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);
}
--
2.18.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2 net-next] net: ll_temac: Fix an NULL vs IS_ERR() check in temac_open()
2019-05-03 12:50 [PATCH 1/2 net-next] net: ll_temac: Fix an NULL vs IS_ERR() check in temac_open() Dan Carpenter
2019-05-03 12:50 ` [PATCH 2/2 net-next] net: ll_temac: remove an unnecessary condition Dan Carpenter
@ 2019-05-05 17:29 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2019-05-05 17:29 UTC (permalink / raw)
To: dan.carpenter
Cc: esben, michal.simek, andrew, yang.wei9, yuehaibing, mcgrof,
netdev, kernel-janitors
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 3 May 2019 15:50:24 +0300
> 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 <dan.carpenter@oracle.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2 net-next] net: ll_temac: remove an unnecessary condition
2019-05-03 12:50 ` [PATCH 2/2 net-next] net: ll_temac: remove an unnecessary condition Dan Carpenter
@ 2019-05-05 17:29 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-05-05 17:29 UTC (permalink / raw)
To: dan.carpenter; +Cc: esben, michal.simek, andrew, netdev, kernel-janitors
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 3 May 2019 15:50:51 +0300
> The "pdata->mdio_bus_id" is unsigned so this condition is always true.
> This patch just removes it.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-05-05 17:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-03 12:50 [PATCH 1/2 net-next] net: ll_temac: Fix an NULL vs IS_ERR() check in temac_open() Dan Carpenter
2019-05-03 12:50 ` [PATCH 2/2 net-next] net: ll_temac: remove an unnecessary condition Dan Carpenter
2019-05-05 17:29 ` David Miller
2019-05-05 17:29 ` [PATCH 1/2 net-next] net: ll_temac: Fix an NULL vs IS_ERR() check in temac_open() David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).