public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v1] net: sun8i-emac: Add support for fixed-link phy
@ 2023-06-14 21:44 Maxim Kiselev
  2023-07-22  8:20 ` Ramon Fried
  2024-01-16  0:17 ` Andre Przywara
  0 siblings, 2 replies; 8+ messages in thread
From: Maxim Kiselev @ 2023-06-14 21:44 UTC (permalink / raw)
  To: u-boot; +Cc: Maksim Kiselev, Joe Hershberger, Ramon Fried

From: Maksim Kiselev <bigunclemax@gmail.com>

Based on dt-specs fixed-link doesn't require phy-handle to be used.
Fix driver to only read phy related setting when phy-handle is found.

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
---
 drivers/net/sun8i_emac.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
index 04c3274fbe..0e339d69e0 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -834,11 +834,8 @@ static int sun8i_emac_eth_of_to_plat(struct udevice *dev)
 	priv->use_internal_phy = false;
 
 	offset = fdtdec_lookup_phandle(gd->fdt_blob, node, "phy-handle");
-	if (offset < 0) {
-		debug("%s: Cannot find PHY address\n", __func__);
-		return -EINVAL;
-	}
-	priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", -1);
+	if (offset >= 0)
+		priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", -1);
 
 	pdata->phy_interface = dev_read_phy_mode(dev);
 	debug("phy interface %d\n", pdata->phy_interface);
-- 
2.39.2


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

end of thread, other threads:[~2024-01-19 21:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-14 21:44 [PATCH v1] net: sun8i-emac: Add support for fixed-link phy Maxim Kiselev
2023-07-22  8:20 ` Ramon Fried
2024-01-16  0:17 ` Andre Przywara
2024-01-16 16:58   ` Maxim Kiselev
2024-01-17  0:13     ` Andre Przywara
2024-01-19 17:35     ` Andre Przywara
2024-01-19 18:11       ` Maxim Kiselev
2024-01-19 21:56         ` Andre Przywara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox