lkml.org 
[lkml]   [2019]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/3] net: macb: fix for fixed-link mode
Date
This patch fix the issue with fixed link mode in macb.

Signed-off-by: Milind Parab <mparab@cadence.com>
---
drivers/net/ethernet/cadence/macb_main.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index d5ae2e1e0b0e..5e6d27d33d43 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -617,15 +617,11 @@ static int macb_phylink_connect(struct macb *bp)
struct phy_device *phydev;
int ret;

- if (bp->pdev->dev.of_node &&
- of_parse_phandle(bp->pdev->dev.of_node, "phy-handle", 0)) {
+ if (bp->pdev->dev.of_node)
ret = phylink_of_phy_connect(bp->phylink, bp->pdev->dev.of_node,
0);
- if (ret) {
- netdev_err(dev, "Could not attach PHY (%d)\n", ret);
- return ret;
- }
- } else {
+
+ if ((!bp->pdev->dev.of_node || ret == -ENODEV) && bp->mii_bus) {
phydev = phy_find_first(bp->mii_bus);
if (!phydev) {
netdev_err(dev, "no PHY found\n");
@@ -635,7 +631,7 @@ static int macb_phylink_connect(struct macb *bp)
/* attach the mac to the phy */
ret = phylink_connect_phy(bp->phylink, phydev);
if (ret) {
- netdev_err(dev, "Could not attach to PHY (%d)\n", ret);
+ netdev_err(dev, "Could not attach to PHY\n");
return ret;
}
}
--
2.17.1
\
 
 \ /
  Last update: 2019-11-26 10:11    [W:0.100 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site