From: Russell King (Oracle) Date: Mon, 14 Apr 2025 09:06:05 +0000 (+0100) Subject: net: stmmac: anarion: clean up interface parsing X-Git-Tag: v6.16-rc1~132^2~296^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a55ec9c811aa25504951113b45e1df60ab6d751c;p=thirdparty%2Fkernel%2Flinux.git net: stmmac: anarion: clean up interface parsing anarion_config_dt() used a switch statement to check for the RGMII modes, complete with an unnecessary "fallthrough", and also printed the numerical value of the PHY interface mode on error. Clean this up using the phy_interface_mode_is_rgmii() helper, and print the English version of the PHY interface mode on error. Reviewed-by: Andrew Lunn Signed-off-by: Russell King (Oracle) Link: https://patch.msgid.link/E1u4FlV-000XjG-83@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c index 232aae7526905..941ea724c6432 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c @@ -79,17 +79,11 @@ anarion_config_dt(struct platform_device *pdev, gmac->ctl_block = ctl_block; - switch (plat_dat->phy_interface) { - case PHY_INTERFACE_MODE_RGMII: - fallthrough; - case PHY_INTERFACE_MODE_RGMII_ID: - case PHY_INTERFACE_MODE_RGMII_RXID: - case PHY_INTERFACE_MODE_RGMII_TXID: + if (phy_interface_mode_is_rgmii(plat_dat->phy_interface)) { gmac->phy_intf_sel = GMAC_CONFIG_INTF_RGMII; - break; - default: - dev_err(&pdev->dev, "Unsupported phy-mode (%d)\n", - plat_dat->phy_interface); + } else { + dev_err(&pdev->dev, "Unsupported phy-mode (%s)\n", + phy_modes(plat_dat->phy_interface)); return ERR_PTR(-ENOTSUPP); }