aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-12-01 16:14:39 +0000
committerJohn Crispin <blogic@openwrt.org>2014-12-01 16:14:39 +0000
commit8a609f9af771939e16a618070f774ac6002926a8 (patch)
tree9f28f10ebb7e5445b16c4ae06af7d04d665b2b8b
parent5a3c2d9aa70ff08963dc866ccde9c4f765b6c12a (diff)
downloadupstream-8a609f9af771939e16a618070f774ac6002926a8.tar.gz
upstream-8a609f9af771939e16a618070f774ac6002926a8.tar.bz2
upstream-8a609f9af771939e16a618070f774ac6002926a8.zip
ar8216: factor out mib_func to ar8xxx_chip
Factor out mib_func to ar8xxx_chip. Remove related chip_is_... checks. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43467 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 028b98fc40..effa33c4fb 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -86,6 +86,7 @@ struct ar8xxx_chip {
const struct ar8xxx_mib_desc *mib_decs;
unsigned num_mibs;
+ unsigned mib_func;
};
enum ar8327_led_pattern {
@@ -532,16 +533,11 @@ ar8xxx_reg_wait(struct ar8xxx_priv *priv, u32 reg, u32 mask, u32 val,
static int
ar8xxx_mib_op(struct ar8xxx_priv *priv, u32 op)
{
- unsigned mib_func;
+ unsigned mib_func = priv->chip->mib_func;
int ret;
lockdep_assert_held(&priv->mib_lock);
- if (chip_is_ar8327(priv) || chip_is_ar8337(priv))
- mib_func = AR8327_REG_MIB_FUNC;
- else
- mib_func = AR8216_REG_MIB_FUNC;
-
/* Capture the hardware statistics for all ports */
ar8xxx_rmw(priv, mib_func, AR8216_MIB_FUNC, (op << AR8216_MIB_FUNC_S));
@@ -898,6 +894,7 @@ static const struct ar8xxx_chip ar8216_chip = {
.num_mibs = ARRAY_SIZE(ar8216_mibs),
.mib_decs = ar8216_mibs,
+ .mib_func = AR8216_REG_MIB_FUNC
};
static void
@@ -964,6 +961,7 @@ static const struct ar8xxx_chip ar8236_chip = {
.num_mibs = ARRAY_SIZE(ar8236_mibs),
.mib_decs = ar8236_mibs,
+ .mib_func = AR8216_REG_MIB_FUNC
};
static int
@@ -1047,6 +1045,7 @@ static const struct ar8xxx_chip ar8316_chip = {
.num_mibs = ARRAY_SIZE(ar8236_mibs),
.mib_decs = ar8236_mibs,
+ .mib_func = AR8216_REG_MIB_FUNC
};
static u32
@@ -1836,6 +1835,7 @@ static const struct ar8xxx_chip ar8327_chip = {
.num_mibs = ARRAY_SIZE(ar8236_mibs),
.mib_decs = ar8236_mibs,
+ .mib_func = AR8327_REG_MIB_FUNC
};
static int