diff options
author | Andrew Lunn <andrew@lunn.ch> | 2016-04-13 02:40:42 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-14 00:15:23 +0200 |
commit | a77d43f1e9d59791b138b9903c58b89fffb0df97 (patch) | |
tree | d878967d148d62ceb9739bc4e5a9fdd63b363559 /drivers/net/dsa/mv88e6xxx.h | |
parent | net: dsa: Remove allocation of driver private memory (diff) | |
download | linux-a77d43f1e9d59791b138b9903c58b89fffb0df97.tar.xz linux-a77d43f1e9d59791b138b9903c58b89fffb0df97.zip |
net: dsa: Keep the mii bus and address in the private structure
Rather than looking up the mii bus and address every time, do it once
at probe, and keep it in the private structure. Centralise this probe
code in mv88e6xxx.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx.h')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h index 0322e3e0e7d9..5d27decc85cb 100644 --- a/drivers/net/dsa/mv88e6xxx.h +++ b/drivers/net/dsa/mv88e6xxx.h @@ -406,6 +406,12 @@ struct mv88e6xxx_priv_state { */ struct mutex smi_mutex; + /* The MII bus and the address on the bus that is used to + * communication with the switch + */ + struct mii_bus *bus; + int sw_addr; + #ifdef CONFIG_NET_DSA_MV88E6XXX_NEED_PPU /* Handles automatic disabling and re-enabling of the PHY * polling unit. @@ -456,9 +462,11 @@ struct mv88e6xxx_hw_stat { }; int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active); -char *mv88e6xxx_lookup_name(struct device *host_dev, int sw_addr, - const struct mv88e6xxx_switch_id *table, - unsigned int num); +char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev, + int sw_addr, void **priv, + const struct mv88e6xxx_switch_id *table, + unsigned int num); + int mv88e6xxx_setup_ports(struct dsa_switch *ds); int mv88e6xxx_setup_common(struct dsa_switch *ds); int mv88e6xxx_setup_global(struct dsa_switch *ds); |