From: Milind Parab <mparab@cadence.com>
To: <andrew@lunn.ch>, <antoine.tenart@bootlin.com>
Cc: <nicolas.ferre@microchip.com>, <davem@davemloft.net>,
<netdev@vger.kernel.org>, <f.fainelli@gmail.com>,
<hkallweit1@gmail.com>, <linux-kernel@vger.kernel.org>,
<dkangude@cadence.com>, <pthombar@cadence.com>,
Milind Parab <mparab@cadence.com>
Subject: [PATCH 1/3] net: macb: fix for fixed-link mode
Date: Tue, 26 Nov 2019 09:09:40 +0000 [thread overview]
Message-ID: <1574759380-102986-1-git-send-email-mparab@cadence.com> (raw)
In-Reply-To: <1574759354-102696-1-git-send-email-mparab@cadence.com>
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
next prev parent reply other threads:[~2019-11-26 9:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-26 9:09 [PATCH 0/3] net: macb: cover letter Milind Parab
2019-11-26 9:09 ` Milind Parab [this message]
2019-11-26 14:30 ` [PATCH 1/3] net: macb: fix for fixed-link mode Andrew Lunn
2019-11-27 18:02 ` Nicolas.Ferre
2019-11-28 6:50 ` Milind Parab
2019-11-26 9:09 ` [PATCH 2/3] net: macb: add support for C45 MDIO read/write Milind Parab
2019-11-26 14:37 ` Andrew Lunn
2019-11-27 18:31 ` Nicolas.Ferre
2019-11-27 18:51 ` Andrew Lunn
2019-11-28 8:29 ` Milind Parab
2019-11-28 14:52 ` Andrew Lunn
2019-11-29 10:02 ` Milind Parab
2019-11-26 9:09 ` [PATCH 3/3] net: macb: add support for high speed interface Milind Parab
2019-11-26 18:09 ` [PATCH 0/3] net: macb: cover letter David Miller
2019-12-09 11:13 [PATCH 0/3] net: macb: fix for fixed link, support for c45 mdio and 10G Milind Parab
2019-12-09 11:14 ` [PATCH 1/3] net: macb: fix for fixed-link mode Milind Parab
2019-12-09 11:26 ` Russell King - ARM Linux admin
2019-12-10 9:14 ` Milind Parab
2019-12-10 11:38 ` Russell King - ARM Linux admin
2019-12-11 8:21 ` Milind Parab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1574759380-102986-1-git-send-email-mparab@cadence.com \
--to=mparab@cadence.com \
--cc=andrew@lunn.ch \
--cc=antoine.tenart@bootlin.com \
--cc=davem@davemloft.net \
--cc=dkangude@cadence.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=pthombar@cadence.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).