aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6352.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/dsa/mv88e6352.c')
-rw-r--r--drivers/net/dsa/mv88e6352.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/dsa/mv88e6352.c b/drivers/net/dsa/mv88e6352.c
index 577ab2cfa944..7081a78a67e1 100644
--- a/drivers/net/dsa/mv88e6352.c
+++ b/drivers/net/dsa/mv88e6352.c
@@ -38,10 +38,20 @@ static const struct mv88e6xxx_switch_id mv88e6352_table[] = {
38}; 38};
39 39
40static char *mv88e6352_probe(struct device *dsa_dev, struct device *host_dev, 40static char *mv88e6352_probe(struct device *dsa_dev, struct device *host_dev,
41 int sw_addr) 41 int sw_addr, void **priv)
42{ 42{
43 return mv88e6xxx_lookup_name(host_dev, sw_addr, mv88e6352_table, 43 struct mv88e6xxx_priv_state *ps;
44 char *name;
45
46 name = mv88e6xxx_lookup_name(host_dev, sw_addr, mv88e6352_table,
44 ARRAY_SIZE(mv88e6352_table)); 47 ARRAY_SIZE(mv88e6352_table));
48 if (name) {
49 ps = devm_kzalloc(dsa_dev, sizeof(*ps), GFP_KERNEL);
50 if (!ps)
51 return NULL;
52 *priv = ps;
53 }
54 return name;
45} 55}
46 56
47static int mv88e6352_setup_global(struct dsa_switch *ds) 57static int mv88e6352_setup_global(struct dsa_switch *ds)
@@ -82,6 +92,8 @@ static int mv88e6352_setup(struct dsa_switch *ds)
82 struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); 92 struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
83 int ret; 93 int ret;
84 94
95 ps->ds = ds;
96
85 ret = mv88e6xxx_setup_common(ds); 97 ret = mv88e6xxx_setup_common(ds);
86 if (ret < 0) 98 if (ret < 0)
87 return ret; 99 return ret;
@@ -303,7 +315,6 @@ static int mv88e6352_set_eeprom(struct dsa_switch *ds,
303 315
304struct dsa_switch_driver mv88e6352_switch_driver = { 316struct dsa_switch_driver mv88e6352_switch_driver = {
305 .tag_protocol = DSA_TAG_PROTO_EDSA, 317 .tag_protocol = DSA_TAG_PROTO_EDSA,
306 .priv_size = sizeof(struct mv88e6xxx_priv_state),
307 .probe = mv88e6352_probe, 318 .probe = mv88e6352_probe,
308 .setup = mv88e6352_setup, 319 .setup = mv88e6352_setup,
309 .set_addr = mv88e6xxx_set_addr_indirect, 320 .set_addr = mv88e6xxx_set_addr_indirect,