[PATCH net-next 11/16] net: stmmac: starfive: use stmmac_get_phy_intf_sel()
Russell King (Oracle)
linux at armlinux.org.uk
Fri Nov 7 08:08:57 PST 2025
On Fri, Nov 07, 2025 at 11:00:35AM -0500, Emil Renner Berthing wrote:
> Quoting Russell King (Oracle) (2025-11-07 15:28:55)
> > Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the
> > phy_intf_sel value, validate the result and use that to set the
> > control register to select the operating mode for the DWMAC core.
> >
> > Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
> > ---
> > .../ethernet/stmicro/stmmac/dwmac-starfive.c | 22 +++++--------------
> > 1 file changed, 6 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
> > index 1ef72576c6f1..00078b7a6486 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
> > @@ -35,25 +35,15 @@ static int starfive_dwmac_set_mode(struct plat_stmmacenet_data *plat_dat)
> > struct starfive_dwmac *dwmac = plat_dat->bsp_priv;
> > struct regmap *regmap;
> > unsigned int args[2];
> > - unsigned int mode;
> > + int phy_intf_sel;
> > int err;
> >
> > - switch (plat_dat->phy_interface) {
> > - case PHY_INTERFACE_MODE_RMII:
> > - mode = STARFIVE_DWMAC_PHY_INFT_RMII;
> > - break;
> > -
> > - case PHY_INTERFACE_MODE_RGMII:
> > - case PHY_INTERFACE_MODE_RGMII_ID:
> > - case PHY_INTERFACE_MODE_RGMII_RXID:
> > - case PHY_INTERFACE_MODE_RGMII_TXID:
> > - mode = STARFIVE_DWMAC_PHY_INFT_RGMII;
> > - break;
>
> After these two patches the STARFIVE_DWMAC_PHY_INFT_RMII and ..RGMII macros are
> left unused.
Thanks, I'll remove them in this patch.
> Maybe just squash the patches and remove the definitions?
It's two logical changes, thus two patches. Reviewers find that this
makes it easier to review.
Given the number of platform glues that I'm modifying, I don't want
to change some of them using one big all encompassing patch and
others as a set of logical changes - that would be totally insane
to manage.
--
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