Skip to content

Commit a0c157d

Browse files
Russell King (Oracle)NipaLocal
authored andcommitted
net: stmmac: thead: convert to use phy_interface
dwmac-thead supports either MII or RGMII interface modes only. None of the DTS files set "mac-mode", so mac_interface will be identical to phy_interface. Convert dwmac-thead to use phy_interface when determining the interface mode 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) <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 4c17483 commit a0c157d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static int thead_dwmac_set_phy_if(struct plat_stmmacenet_data *plat)
5656
struct thead_dwmac *dwmac = plat->bsp_priv;
5757
u32 phyif;
5858

59-
switch (plat->mac_interface) {
59+
switch (plat->phy_interface) {
6060
case PHY_INTERFACE_MODE_MII:
6161
phyif = PHY_INTF_MII_GMII;
6262
break;
@@ -67,8 +67,8 @@ static int thead_dwmac_set_phy_if(struct plat_stmmacenet_data *plat)
6767
phyif = PHY_INTF_RGMII;
6868
break;
6969
default:
70-
dev_err(dwmac->dev, "unsupported phy interface %d\n",
71-
plat->mac_interface);
70+
dev_err(dwmac->dev, "unsupported phy interface %s\n",
71+
phy_modes(plat->phy_interface));
7272
return -EINVAL;
7373
}
7474

@@ -81,7 +81,7 @@ static int thead_dwmac_set_txclk_dir(struct plat_stmmacenet_data *plat)
8181
struct thead_dwmac *dwmac = plat->bsp_priv;
8282
u32 txclk_dir;
8383

84-
switch (plat->mac_interface) {
84+
switch (plat->phy_interface) {
8585
case PHY_INTERFACE_MODE_MII:
8686
txclk_dir = TXCLK_DIR_INPUT;
8787
break;
@@ -92,8 +92,8 @@ static int thead_dwmac_set_txclk_dir(struct plat_stmmacenet_data *plat)
9292
txclk_dir = TXCLK_DIR_OUTPUT;
9393
break;
9494
default:
95-
dev_err(dwmac->dev, "unsupported phy interface %d\n",
96-
plat->mac_interface);
95+
dev_err(dwmac->dev, "unsupported phy interface %s\n",
96+
phy_modes(plat->phy_interface));
9797
return -EINVAL;
9898
}
9999

@@ -112,7 +112,7 @@ static int thead_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
112112

113113
plat = dwmac->plat;
114114

115-
switch (plat->mac_interface) {
115+
switch (plat->phy_interface) {
116116
/* For MII, rxc/txc is provided by phy */
117117
case PHY_INTERFACE_MODE_MII:
118118
return 0;
@@ -143,8 +143,8 @@ static int thead_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
143143
return 0;
144144

145145
default:
146-
dev_err(dwmac->dev, "unsupported phy interface %d\n",
147-
plat->mac_interface);
146+
dev_err(dwmac->dev, "unsupported phy interface %s\n",
147+
phy_modes(plat->phy_interface));
148148
return -EINVAL;
149149
}
150150
}
@@ -154,7 +154,7 @@ static int thead_dwmac_enable_clk(struct plat_stmmacenet_data *plat)
154154
struct thead_dwmac *dwmac = plat->bsp_priv;
155155
u32 reg, div;
156156

157-
switch (plat->mac_interface) {
157+
switch (plat->phy_interface) {
158158
case PHY_INTERFACE_MODE_MII:
159159
reg = GMAC_RX_CLK_EN | GMAC_TX_CLK_EN;
160160
break;
@@ -177,8 +177,8 @@ static int thead_dwmac_enable_clk(struct plat_stmmacenet_data *plat)
177177
break;
178178

179179
default:
180-
dev_err(dwmac->dev, "unsupported phy interface %d\n",
181-
plat->mac_interface);
180+
dev_err(dwmac->dev, "unsupported phy interface %s\n",
181+
phy_modes(plat->phy_interface));
182182
return -EINVAL;
183183
}
184184

0 commit comments

Comments
 (0)