[PATCH net-next 16/16] net: stmmac: visconti: use stmmac_get_phy_intf_sel()

Russell King (Oracle) linux at armlinux.org.uk
Fri Nov 7 23:58:19 PST 2025


On Fri, Nov 07, 2025 at 07:23:26PM +0100, Maxime Chevallier wrote:
> Hi Russell,
> 
> On 07/11/2025 15:29, Russell King (Oracle) wrote:
> > -	switch (plat_dat->phy_interface) {
> > -	case PHY_INTERFACE_MODE_RGMII:
> > -	case PHY_INTERFACE_MODE_RGMII_ID:
> > -	case PHY_INTERFACE_MODE_RGMII_RXID:
> > -	case PHY_INTERFACE_MODE_RGMII_TXID:
> > -		phy_intf_sel = ETHER_CONFIG_INTF_RGMII;
> > -		break;
> > -	case PHY_INTERFACE_MODE_MII:
> > -		phy_intf_sel = ETHER_CONFIG_INTF_MII;
> > -		break;
> > -	case PHY_INTERFACE_MODE_RMII:
> > -		phy_intf_sel = ETHER_CONFIG_INTF_RMII;
> > -		break;
> > -	default:
> > +	int phy_intf_sel;
> > +
> > +	phy_intf_sel = stmmac_get_phy_intf_sel(plat_dat->phy_interface);
> > +	if (phy_intf_sel != PHY_INTF_SEL_GMII_MII &&
> > +	    phy_intf_sel != PHY_INTF_SEL_RGMII &&
> > +	    phy_intf_sel != PHY_INTF_SEL_RMII) {
> >  		dev_err(&pdev->dev, "Unsupported phy-mode (%d)\n", plat_dat->phy_interface);
> >  		return -EOPNOTSUPP;
> >  	}
> 
> Probably not too big of a deal, but don't we now incorrectly accept the
> "gmii" mode ?

We will accept GMII mode, but (a) does that matter, and (b) shouldn't
the DT binding be checking the phy-mode (we have some bindings that do.)

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



More information about the linux-amlogic mailing list