stmmac: dwmac-sti: clean up and rename sti_dwmac_init

Rename sti_dwmac_init to sti_dwmac_set_mode which is a better
description for what it really does.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Tested-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Joachim Eastwood 2016-11-04 18:54:10 +01:00 committed by David S. Miller
parent b89cbfb01a
commit 0eebedc2fd

View File

@ -229,9 +229,8 @@ static void stid127_fix_retime_src(void *priv, u32 spd)
regmap_update_bits(dwmac->regmap, reg, STID127_RETIME_SRC_MASK, val); regmap_update_bits(dwmac->regmap, reg, STID127_RETIME_SRC_MASK, val);
} }
static int sti_dwmac_init(struct platform_device *pdev, void *priv) static int sti_dwmac_set_mode(struct sti_dwmac *dwmac)
{ {
struct sti_dwmac *dwmac = priv;
struct regmap *regmap = dwmac->regmap; struct regmap *regmap = dwmac->regmap;
int iface = dwmac->interface; int iface = dwmac->interface;
u32 reg = dwmac->ctrl_reg; u32 reg = dwmac->ctrl_reg;
@ -245,7 +244,7 @@ static int sti_dwmac_init(struct platform_device *pdev, void *priv)
val = (iface == PHY_INTERFACE_MODE_REVMII) ? 0 : ENMII; val = (iface == PHY_INTERFACE_MODE_REVMII) ? 0 : ENMII;
regmap_update_bits(regmap, reg, ENMII_MASK, val); regmap_update_bits(regmap, reg, ENMII_MASK, val);
dwmac->fix_retime_src(priv, dwmac->speed); dwmac->fix_retime_src(dwmac, dwmac->speed);
return 0; return 0;
} }
@ -350,7 +349,7 @@ static int sti_dwmac_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
ret = sti_dwmac_init(pdev, plat_dat->bsp_priv); ret = sti_dwmac_set_mode(dwmac);
if (ret) if (ret)
goto disable_clk; goto disable_clk;
@ -389,10 +388,9 @@ static int sti_dwmac_suspend(struct device *dev)
static int sti_dwmac_resume(struct device *dev) static int sti_dwmac_resume(struct device *dev)
{ {
struct sti_dwmac *dwmac = get_stmmac_bsp_priv(dev); struct sti_dwmac *dwmac = get_stmmac_bsp_priv(dev);
struct platform_device *pdev = to_platform_device(dev);
clk_prepare_enable(dwmac->clk); clk_prepare_enable(dwmac->clk);
sti_dwmac_init(pdev, dwmac); sti_dwmac_set_mode(dwmac);
return stmmac_resume(dev); return stmmac_resume(dev);
} }