summaryrefslogtreecommitdiff
path: root/target/linux/generic/files
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-03-18 22:06:15 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-03-18 22:06:15 +0000
commiteb5f0067b67f99b01df12ea4166205d2b5810c15 (patch)
tree049d1c8f4fe0f2f3b334ef42073c624af2b86238 /target/linux/generic/files
parenta8371ad5667797882980baa7cc232dd381ac9675 (diff)
downloadmtk-20170518-eb5f0067b67f99b01df12ea4166205d2b5810c15.zip
mtk-20170518-eb5f0067b67f99b01df12ea4166205d2b5810c15.tar.gz
mtk-20170518-eb5f0067b67f99b01df12ea4166205d2b5810c15.tar.bz2
generic: ar8216: add hw_init field to ar8xxx_chip
SVN-Revision: 30998
Diffstat (limited to 'target/linux/generic/files')
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 038a086..3408451 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -36,7 +36,10 @@
#define AR8X16_MAX_VLANS 128
#define AR8X16_PROBE_RETRIES 10
+struct ar8216_priv;
+
struct ar8xxx_chip {
+ int (*hw_init)(struct ar8216_priv *priv);
};
struct ar8216_priv {
@@ -741,12 +744,15 @@ ar8216_init_port(struct ar8216_priv *priv, int port)
}
static const struct ar8xxx_chip ar8216_chip = {
+ .hw_init = ar8216_hw_init,
};
static const struct ar8xxx_chip ar8236_chip = {
+ .hw_init = ar8236_hw_init,
};
static const struct ar8xxx_chip ar8316_chip = {
+ .hw_init = ar8316_hw_init,
};
static int
@@ -943,14 +949,7 @@ ar8216_config_init(struct phy_device *pdev)
priv->init = true;
- ret = 0;
- if (priv->chip_type == AR8216)
- ret = ar8216_hw_init(priv);
- else if (priv->chip_type == AR8236)
- ret = ar8236_hw_init(priv);
- else if (priv->chip_type == AR8316)
- ret = ar8316_hw_init(priv);
-
+ ret = priv->chip->hw_init(priv);
if (ret)
goto err_free_priv;