aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-03-15 15:50:05 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-03-15 15:50:05 +0000
commit74ed419c1c362bb6ee4964de3bba260ae1a89dfb (patch)
treeafb28efae97c4d2894c778c8bbdd463f6bcd5581
parent11d65c1f3530aab0774a60b4924ca6496b4353d5 (diff)
downloadupstream-74ed419c1c362bb6ee4964de3bba260ae1a89dfb.tar.gz
upstream-74ed419c1c362bb6ee4964de3bba260ae1a89dfb.tar.bz2
upstream-74ed419c1c362bb6ee4964de3bba260ae1a89dfb.zip
generic: ar8216: separate platform_data based AR8327 code
Move platform_data specific configuration code into a separate routine. Do it in preparation for the upcoming OF support. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36046 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 74fecd6f85..d4ef7bd195 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -1039,17 +1039,14 @@ ar8327_get_port_init_status(struct ar8327_port_cfg *cfg)
}
static int
-ar8327_hw_init(struct ar8xxx_priv *priv)
+ar8327_hw_config_pdata(struct ar8xxx_priv *priv,
+ struct ar8327_platform_data *pdata)
{
- struct ar8327_platform_data *pdata;
struct ar8327_led_cfg *led_cfg;
struct ar8327_data *data;
- struct mii_bus *bus;
u32 pos, new_pos;
u32 t;
- int i;
- pdata = priv->phy->dev.platform_data;
if (!pdata)
return -EINVAL;
@@ -1086,6 +1083,20 @@ ar8327_hw_init(struct ar8xxx_priv *priv)
priv->write(priv, AR8327_REG_POWER_ON_STRIP, new_pos);
}
+ return 0;
+}
+
+static int
+ar8327_hw_init(struct ar8xxx_priv *priv)
+{
+ struct mii_bus *bus;
+ int ret;
+ int i;
+
+ ret = ar8327_hw_config_pdata(priv, priv->phy->dev.platform_data);
+ if (ret)
+ return ret;
+
bus = priv->mii_bus;
for (i = 0; i < AR8327_NUM_PHYS; i++) {
ar8327_phy_fixup(priv, i);