Skip to content

Commit eefed63

Browse files
grygoriySkishon
authored andcommitted
phy: ti: gmii-sel: fix set of copy-paste errors
- under PHY_INTERFACE_MODE_MII the 'mode' func parameter is assigned instead of 'gmii_sel_mode' and it's working only because the default value 'gmii_sel_mode' is set to 0. - console outputs use 'rgmii_id' and 'mode' values to print PHY mode instead of using 'submode' value which is representing PHY interface mode now. This patch fixes above two cases. Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
1 parent 1d7cb11 commit eefed63

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/phy/ti/phy-gmii-sel.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,19 @@ static int phy_gmii_sel_mode(struct phy *phy, enum phy_mode mode, int submode)
8080
break;
8181

8282
case PHY_INTERFACE_MODE_MII:
83-
mode = AM33XX_GMII_SEL_MODE_MII;
83+
gmii_sel_mode = AM33XX_GMII_SEL_MODE_MII;
8484
break;
8585

8686
default:
87-
dev_warn(dev,
88-
"port%u: unsupported mode: \"%s\". Defaulting to MII.\n",
89-
if_phy->id, phy_modes(rgmii_id));
87+
dev_warn(dev, "port%u: unsupported mode: \"%s\"\n",
88+
if_phy->id, phy_modes(submode));
9089
return -EINVAL;
9190
}
9291

9392
if_phy->phy_if_mode = submode;
9493

9594
dev_dbg(dev, "%s id:%u mode:%u rgmii_id:%d rmii_clk_ext:%d\n",
96-
__func__, if_phy->id, mode, rgmii_id,
95+
__func__, if_phy->id, submode, rgmii_id,
9796
if_phy->rmii_clock_external);
9897

9998
regfield = if_phy->fields[PHY_GMII_SEL_PORT_MODE];

0 commit comments

Comments
 (0)