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/mv88e6171.c | |
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/mv88e6171.c')
-rw-r--r-- | drivers/net/dsa/mv88e6171.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c index 15200928cecc..6ab86071391f 100644 --- a/drivers/net/dsa/mv88e6171.c +++ b/drivers/net/dsa/mv88e6171.c @@ -27,18 +27,9 @@ static const struct mv88e6xxx_switch_id mv88e6171_table[] = { static char *mv88e6171_probe(struct device *dsa_dev, struct device *host_dev, int sw_addr, void **priv) { - struct mv88e6xxx_priv_state *ps; - char *name; - - name = mv88e6xxx_lookup_name(host_dev, sw_addr, mv88e6171_table, - ARRAY_SIZE(mv88e6171_table)); - if (name) { - ps = devm_kzalloc(dsa_dev, sizeof(*ps), GFP_KERNEL); - if (!ps) - return NULL; - *priv = ps; - } - return name; + return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv, + mv88e6171_table, + ARRAY_SIZE(mv88e6171_table)); } static int mv88e6171_setup_global(struct dsa_switch *ds) |