Move phy fixup code from the chip-specific hw_init functions into a
fixup_phys callback.

Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com>
---
 target/linux/generic/files/drivers/net/phy/ar8216.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c 
b/target/linux/generic/files/drivers/net/phy/ar8216.c
index ffc5dcf..a0bf10a 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -80,6 +80,7 @@ struct ar8xxx_chip {
        int (*atu_flush)(struct ar8xxx_priv *priv);
        void (*vtu_flush)(struct ar8xxx_priv *priv);
        void (*vtu_load_vlan)(struct ar8xxx_priv *priv, u32 vid, u32 port_mask);
+       void (*phy_fixup)(struct ar8xxx_priv *priv, int phy);
 
        const struct ar8xxx_mib_desc *mib_decs;
        unsigned num_mibs;
@@ -1636,7 +1637,7 @@ ar8327_hw_init(struct ar8xxx_priv *priv)
 
        bus = priv->mii_bus;
        for (i = 0; i < AR8XXX_NUM_PHYS; i++) {
-               ar8327_phy_fixup(priv, i);
+               priv->chip->phy_fixup(priv, i);
 
                /* start aneg on the PHY */
                mdiobus_write(bus, i, MII_ADVERTISE, ADVERTISE_ALL |
@@ -1825,6 +1826,7 @@ static const struct ar8xxx_chip ar8327_chip = {
        .atu_flush = ar8327_atu_flush,
        .vtu_flush = ar8327_vtu_flush,
        .vtu_load_vlan = ar8327_vtu_load_vlan,
+       .phy_fixup = ar8327_phy_fixup,
 
        .num_mibs = ARRAY_SIZE(ar8236_mibs),
        .mib_decs = ar8236_mibs,
-- 
2.1.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to