Commit 0eebedc2 authored by Joachim Eastwood's avatar Joachim Eastwood Committed by David S. Miller

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: default avatarJoachim Eastwood <manabian@gmail.com>
Acked-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Tested-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b89cbfb0
......@@ -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);
}
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;
int iface = dwmac->interface;
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;
regmap_update_bits(regmap, reg, ENMII_MASK, val);
dwmac->fix_retime_src(priv, dwmac->speed);
dwmac->fix_retime_src(dwmac, dwmac->speed);
return 0;
}
......@@ -350,7 +349,7 @@ static int sti_dwmac_probe(struct platform_device *pdev)
if (ret)
return ret;
ret = sti_dwmac_init(pdev, plat_dat->bsp_priv);
ret = sti_dwmac_set_mode(dwmac);
if (ret)
goto disable_clk;
......@@ -389,10 +388,9 @@ static int sti_dwmac_suspend(struct device *dev)
static int sti_dwmac_resume(struct device *dev)
{
struct sti_dwmac *dwmac = get_stmmac_bsp_priv(dev);
struct platform_device *pdev = to_platform_device(dev);
clk_prepare_enable(dwmac->clk);
sti_dwmac_init(pdev, dwmac);
sti_dwmac_set_mode(dwmac);
return stmmac_resume(dev);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment