generic: ar8216: add ar8xxx_start helper
Move switch starting code into a separate function. This makes it usable from other places. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36049 3c298f89-4303-0410-b956-a3cf2f4a3e73master
parent
adb4109f8b
commit
07e8f60ec8
|
@ -1913,6 +1913,28 @@ ar8xxx_probe_switch(struct ar8xxx_priv *priv)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ar8xxx_start(struct ar8xxx_priv *priv)
|
||||
{
|
||||
int ret;
|
||||
|
||||
priv->init = true;
|
||||
|
||||
ret = priv->chip->hw_init(priv);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = ar8xxx_sw_reset_switch(&priv->dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
priv->init = false;
|
||||
|
||||
ar8xxx_mib_start(priv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ar8xxx_phy_config_init(struct phy_device *phydev)
|
||||
{
|
||||
|
@ -1938,13 +1960,7 @@ ar8xxx_phy_config_init(struct phy_device *phydev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
priv->init = true;
|
||||
|
||||
ret = priv->chip->hw_init(priv);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = ar8xxx_sw_reset_switch(&priv->dev);
|
||||
ret = ar8xxx_start(priv);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -1956,10 +1972,6 @@ ar8xxx_phy_config_init(struct phy_device *phydev)
|
|||
dev->eth_mangle_tx = ar8216_mangle_tx;
|
||||
}
|
||||
|
||||
priv->init = false;
|
||||
|
||||
ar8xxx_mib_start(priv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue