aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6123.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/dsa/mv88e6123.c')
-rw-r--r--drivers/net/dsa/mv88e6123.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/dsa/mv88e6123.c b/drivers/net/dsa/mv88e6123.c
index ede4c6f0b31a..bcab3ef22448 100644
--- a/drivers/net/dsa/mv88e6123.c
+++ b/drivers/net/dsa/mv88e6123.c
@@ -30,10 +30,20 @@ static const struct mv88e6xxx_switch_id mv88e6123_table[] = {
30}; 30};
31 31
32static char *mv88e6123_probe(struct device *dsa_dev, struct device *host_dev, 32static char *mv88e6123_probe(struct device *dsa_dev, struct device *host_dev,
33 int sw_addr) 33 int sw_addr, void **priv)
34{ 34{
35 return mv88e6xxx_lookup_name(host_dev, sw_addr, mv88e6123_table, 35 struct mv88e6xxx_priv_state *ps;
36 char *name;
37
38 name = mv88e6xxx_lookup_name(host_dev, sw_addr, mv88e6123_table,
36 ARRAY_SIZE(mv88e6123_table)); 39 ARRAY_SIZE(mv88e6123_table));
40 if (name) {
41 ps = devm_kzalloc(dsa_dev, sizeof(*ps), GFP_KERNEL);
42 if (!ps)
43 return NULL;
44 *priv = ps;
45 }
46 return name;
37} 47}
38 48
39static int mv88e6123_setup_global(struct dsa_switch *ds) 49static int mv88e6123_setup_global(struct dsa_switch *ds)
@@ -74,6 +84,8 @@ static int mv88e6123_setup(struct dsa_switch *ds)
74 struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); 84 struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
75 int ret; 85 int ret;
76 86
87 ps->ds = ds;
88
77 ret = mv88e6xxx_setup_common(ds); 89 ret = mv88e6xxx_setup_common(ds);
78 if (ret < 0) 90 if (ret < 0)
79 return ret; 91 return ret;
@@ -103,7 +115,6 @@ static int mv88e6123_setup(struct dsa_switch *ds)
103 115
104struct dsa_switch_driver mv88e6123_switch_driver = { 116struct dsa_switch_driver mv88e6123_switch_driver = {
105 .tag_protocol = DSA_TAG_PROTO_EDSA, 117 .tag_protocol = DSA_TAG_PROTO_EDSA,
106 .priv_size = sizeof(struct mv88e6xxx_priv_state),
107 .probe = mv88e6123_probe, 118 .probe = mv88e6123_probe,
108 .setup = mv88e6123_setup, 119 .setup = mv88e6123_setup,
109 .set_addr = mv88e6xxx_set_addr_indirect, 120 .set_addr = mv88e6xxx_set_addr_indirect,