From 7d1cbb9ba9336780639554581207e8ee147dd7b3 Mon Sep 17 00:00:00 2001 From: Jia Wang Date: Mon, 7 Sep 2026 15:46:51 +0800 Subject: [PATCH] net: stmmac: sophgo: Use common RGMII delay handling Describe the SG2042 internal RX delay through the common stmmac platform data and let stmmac_pltfr_probe() adjust the PHY interface mode. This removes the duplicated mode conversion without changing the hardware behavior. Signed-off-by: Jia Wang Reviewed-by: Maxime Chevallier Link: https://patch.msgid.link/20260907-dwmac-ultrarisc-v2-2-9a39bf8db313@ultrarisc.com Signed-off-by: Paolo Abeni --- drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c index e02ad3762b5f..f62c803665ad 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c @@ -55,14 +55,10 @@ static int sophgo_dwmac_probe(struct platform_device *pdev) return ret; data = device_get_match_data(&pdev->dev); - if (data && data->has_internal_rx_delay) { - plat_dat->phy_interface = phy_fix_phy_mode_for_mac_delays(plat_dat->phy_interface, - false, true); - if (plat_dat->phy_interface == PHY_INTERFACE_MODE_NA) - return -EINVAL; - } + if (data) + plat_dat->has_internal_rx_delay = data->has_internal_rx_delay; - return stmmac_dvr_probe(dev, plat_dat, &stmmac_res); + return stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res); } static const struct sophgo_dwmac_data sg2042_dwmac_data = {