diff options
Diffstat (limited to 'drivers/net/dsa/mv88e6171.c')
-rw-r--r-- | drivers/net/dsa/mv88e6171.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c index fb35d3ac1644..15200928cecc 100644 --- a/drivers/net/dsa/mv88e6171.c +++ b/drivers/net/dsa/mv88e6171.c | |||
@@ -25,10 +25,20 @@ static const struct mv88e6xxx_switch_id mv88e6171_table[] = { | |||
25 | }; | 25 | }; |
26 | 26 | ||
27 | static char *mv88e6171_probe(struct device *dsa_dev, struct device *host_dev, | 27 | static char *mv88e6171_probe(struct device *dsa_dev, struct device *host_dev, |
28 | int sw_addr) | 28 | int sw_addr, void **priv) |
29 | { | 29 | { |
30 | return mv88e6xxx_lookup_name(host_dev, sw_addr, mv88e6171_table, | 30 | struct mv88e6xxx_priv_state *ps; |
31 | char *name; | ||
32 | |||
33 | name = mv88e6xxx_lookup_name(host_dev, sw_addr, mv88e6171_table, | ||
31 | ARRAY_SIZE(mv88e6171_table)); | 34 | ARRAY_SIZE(mv88e6171_table)); |
35 | if (name) { | ||
36 | ps = devm_kzalloc(dsa_dev, sizeof(*ps), GFP_KERNEL); | ||
37 | if (!ps) | ||
38 | return NULL; | ||
39 | *priv = ps; | ||
40 | } | ||
41 | return name; | ||
32 | } | 42 | } |
33 | 43 | ||
34 | static int mv88e6171_setup_global(struct dsa_switch *ds) | 44 | static int mv88e6171_setup_global(struct dsa_switch *ds) |
@@ -70,6 +80,8 @@ static int mv88e6171_setup(struct dsa_switch *ds) | |||
70 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); | 80 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
71 | int ret; | 81 | int ret; |
72 | 82 | ||
83 | ps->ds = ds; | ||
84 | |||
73 | ret = mv88e6xxx_setup_common(ds); | 85 | ret = mv88e6xxx_setup_common(ds); |
74 | if (ret < 0) | 86 | if (ret < 0) |
75 | return ret; | 87 | return ret; |
@@ -89,7 +101,6 @@ static int mv88e6171_setup(struct dsa_switch *ds) | |||
89 | 101 | ||
90 | struct dsa_switch_driver mv88e6171_switch_driver = { | 102 | struct dsa_switch_driver mv88e6171_switch_driver = { |
91 | .tag_protocol = DSA_TAG_PROTO_EDSA, | 103 | .tag_protocol = DSA_TAG_PROTO_EDSA, |
92 | .priv_size = sizeof(struct mv88e6xxx_priv_state), | ||
93 | .probe = mv88e6171_probe, | 104 | .probe = mv88e6171_probe, |
94 | .setup = mv88e6171_setup, | 105 | .setup = mv88e6171_setup, |
95 | .set_addr = mv88e6xxx_set_addr_indirect, | 106 | .set_addr = mv88e6xxx_set_addr_indirect, |