stmmac: dwmac-sti: clean up and rename sti_dwmac_init
authorJoachim Eastwood <manabian@gmail.com>
Fri, 4 Nov 2016 17:54:10 +0000 (18:54 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Nov 2016 03:00:15 +0000 (22:00 -0500)
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>
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c

index b71888a..ac17bff 100644 (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);
 }
 
-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);
 }