LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next] net: mscc: ocelot: Fix probe for vsc7514
@ 2021-08-17 12:06 Horatiu Vultur
  2021-08-17 12:24 ` Vladimir Oltean
  0 siblings, 1 reply; 3+ messages in thread
From: Horatiu Vultur @ 2021-08-17 12:06 UTC (permalink / raw)
  To: vladimir.oltean, claudiu.manoil, alexandre.belloni,
	UNGLinuxDriver, davem, kuba, netdev, linux-kernel
  Cc: Horatiu Vultur

The check for parsing the 'phy-handle' was removed in the blamed commit.
Therefor it would try to create phylinks for each port and connect to
the phys. But on ocelot_pcb123 and ocelot_pcb120 not all the ports have
a phy, so this will failed. So the probe of the network driver will
fail.

The fix consists in adding back the check for 'phy-handle' for vsc7514

Fixes: e6e12df625f2 ("net: mscc: ocelot: convert to phylink")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 drivers/net/ethernet/mscc/ocelot_vsc7514.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
index 18aed504f45d..96ac64f13382 100644
--- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c
+++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
@@ -954,6 +954,9 @@ static int mscc_ocelot_init_ports(struct platform_device *pdev,
 		if (of_property_read_u32(portnp, "reg", &reg))
 			continue;
 
+		if (!of_parse_phandle(portnp, "phy-handle", 0))
+			continue;
+
 		port = reg;
 		if (port < 0 || port >= ocelot->num_phys_ports) {
 			dev_err(ocelot->dev,
-- 
2.31.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-18  7:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 12:06 [PATCH net-next] net: mscc: ocelot: Fix probe for vsc7514 Horatiu Vultur
2021-08-17 12:24 ` Vladimir Oltean
2021-08-18  7:32   ` Horatiu Vultur

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).