Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: imx: convert to use phy_interface

Checking the IMX8MP documentation, there is no requirement for a
separate mac_interface mode definition. As mac_interface and
phy_interface will be the same, use phy_interface internally rather
than mac_interface.

Also convert the error prints to use phy_modes() so that we get a
meaningful string rather than a number for the interface mode.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1uytpL-00000006H2F-1o6b@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Russell King (Oracle) and committed by
Jakub Kicinski
db1948da 0522f152

+10 -10
+10 -10
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
··· 72 72 struct imx_priv_data *dwmac = plat_dat->bsp_priv; 73 73 int val; 74 74 75 - switch (plat_dat->mac_interface) { 75 + switch (plat_dat->phy_interface) { 76 76 case PHY_INTERFACE_MODE_MII: 77 77 val = GPR_ENET_QOS_INTF_SEL_MII; 78 78 break; ··· 88 88 GPR_ENET_QOS_RGMII_EN; 89 89 break; 90 90 default: 91 - pr_debug("imx dwmac doesn't support %d interface\n", 92 - plat_dat->mac_interface); 91 + pr_debug("imx dwmac doesn't support %s interface\n", 92 + phy_modes(plat_dat->phy_interface)); 93 93 return -EINVAL; 94 94 } 95 95 ··· 112 112 struct imx_priv_data *dwmac = plat_dat->bsp_priv; 113 113 int val, ret; 114 114 115 - switch (plat_dat->mac_interface) { 115 + switch (plat_dat->phy_interface) { 116 116 case PHY_INTERFACE_MODE_MII: 117 117 val = MX93_GPR_ENET_QOS_INTF_SEL_MII; 118 118 break; ··· 134 134 val = MX93_GPR_ENET_QOS_INTF_SEL_RGMII; 135 135 break; 136 136 default: 137 - dev_dbg(dwmac->dev, "imx dwmac doesn't support %d interface\n", 138 - plat_dat->mac_interface); 137 + dev_dbg(dwmac->dev, "imx dwmac doesn't support %s interface\n", 138 + phy_modes(plat_dat->phy_interface)); 139 139 return -EINVAL; 140 140 } 141 141 ··· 197 197 { 198 198 struct imx_priv_data *dwmac = bsp_priv; 199 199 200 - interface = dwmac->plat_dat->mac_interface; 200 + interface = dwmac->plat_dat->phy_interface; 201 201 if (interface == PHY_INTERFACE_MODE_RMII || 202 202 interface == PHY_INTERFACE_MODE_MII) 203 203 return 0; ··· 215 215 plat_dat = dwmac->plat_dat; 216 216 217 217 if (dwmac->ops->mac_rgmii_txclk_auto_adj || 218 - (plat_dat->mac_interface == PHY_INTERFACE_MODE_RMII) || 219 - (plat_dat->mac_interface == PHY_INTERFACE_MODE_MII)) 218 + (plat_dat->phy_interface == PHY_INTERFACE_MODE_RMII) || 219 + (plat_dat->phy_interface == PHY_INTERFACE_MODE_MII)) 220 220 return; 221 221 222 222 rate = rgmii_clock(speed); ··· 274 274 value |= DMA_BUS_MODE_SFT_RESET; 275 275 writel(value, ioaddr + DMA_BUS_MODE); 276 276 277 - if (plat_dat->mac_interface == PHY_INTERFACE_MODE_RMII) { 277 + if (plat_dat->phy_interface == PHY_INTERFACE_MODE_RMII) { 278 278 usleep_range(100, 200); 279 279 writel(RMII_RESET_SPEED, ioaddr + MAC_CTRL_REG); 280 280 }