Re: [PATCH net-next 4/5] net: stmmac: dwmac-socfpga: get the phy_mode with the dedicated helper

From: Russell King (Oracle)

Date: Tue Mar 24 2026 - 06:02:05 EST


On Tue, Mar 24, 2026 at 10:20:59AM +0100, Maxime Chevallier wrote:
> We enable/disable the sgmii_adapter in the .fix_mac_speed() ops based on
> the phy_mode used in the plat_data. We currently get it with :
>
> socfpga_dwmac
> ->dev
> ->drv_data
> ->netdev
> ->priv
> ->stmmac_priv
> ->plat
> ->phy_interface
>
> where we can get it with :
>
> socfpga_dwmac
> ->plat_data
> ->phy_interface (done by socfpga_get_plat_phymode)
>
> Use that helper here.
>
> Note that we are also being passed a phy_interface_t from the
> .fix_mac_speed() callback, provided by phylink.
>
> We can handle that in the future when dynamic interface selection is
> supported. We'd need to guarantee that we have a Lynx PCS to handle it.
>
> Signed-off-by: Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx>

Nice cleanup!

Reviewed-by: Russell King (Oracle) <rmk+kernel@xxxxxxxxxxxxxxx>

Thanks!

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!