Skip to content

Commit

Permalink
phy: ti: gmii-sel: fix set of copy-paste errors
Browse files Browse the repository at this point in the history
- 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]>
  • Loading branch information
grygoriyS authored and kishon committed Feb 20, 2020
1 parent 1d7cb11 commit eefed63
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/phy/ti/phy-gmii-sel.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,19 @@ static int phy_gmii_sel_mode(struct phy *phy, enum phy_mode mode, int submode)
break;

case PHY_INTERFACE_MODE_MII:
mode = AM33XX_GMII_SEL_MODE_MII;
gmii_sel_mode = AM33XX_GMII_SEL_MODE_MII;
break;

default:
dev_warn(dev,
"port%u: unsupported mode: \"%s\". Defaulting to MII.\n",
if_phy->id, phy_modes(rgmii_id));
dev_warn(dev, "port%u: unsupported mode: \"%s\"\n",
if_phy->id, phy_modes(submode));
return -EINVAL;
}

if_phy->phy_if_mode = submode;

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

regfield = if_phy->fields[PHY_GMII_SEL_PORT_MODE];
Expand Down

0 comments on commit eefed63

Please sign in to comment.