diff options
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/mv88e6123_61_65.c | 9 | ||||
-rw-r--r-- | drivers/net/dsa/mv88e6131.c | 9 | ||||
-rw-r--r-- | drivers/net/dsa/mv88e6171.c | 12 | ||||
-rw-r--r-- | drivers/net/dsa/mv88e6352.c | 9 | ||||
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.c | 16 | ||||
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.h | 2 |
6 files changed, 20 insertions, 37 deletions
diff --git a/drivers/net/dsa/mv88e6123_61_65.c b/drivers/net/dsa/mv88e6123_61_65.c index 73325ab520f2..c7c8b1e232ef 100644 --- a/drivers/net/dsa/mv88e6123_61_65.c +++ b/drivers/net/dsa/mv88e6123_61_65.c | |||
@@ -83,7 +83,6 @@ static int mv88e6123_61_65_setup_global(struct dsa_switch *ds) | |||
83 | static int mv88e6123_61_65_setup(struct dsa_switch *ds) | 83 | static int mv88e6123_61_65_setup(struct dsa_switch *ds) |
84 | { | 84 | { |
85 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); | 85 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
86 | int i; | ||
87 | int ret; | 86 | int ret; |
88 | 87 | ||
89 | ret = mv88e6xxx_setup_common(ds); | 88 | ret = mv88e6xxx_setup_common(ds); |
@@ -110,13 +109,7 @@ static int mv88e6123_61_65_setup(struct dsa_switch *ds) | |||
110 | if (ret < 0) | 109 | if (ret < 0) |
111 | return ret; | 110 | return ret; |
112 | 111 | ||
113 | for (i = 0; i < ps->num_ports; i++) { | 112 | return mv88e6xxx_setup_ports(ds); |
114 | ret = mv88e6xxx_setup_port(ds, i); | ||
115 | if (ret < 0) | ||
116 | return ret; | ||
117 | } | ||
118 | |||
119 | return 0; | ||
120 | } | 113 | } |
121 | 114 | ||
122 | struct dsa_switch_driver mv88e6123_61_65_switch_driver = { | 115 | struct dsa_switch_driver mv88e6123_61_65_switch_driver = { |
diff --git a/drivers/net/dsa/mv88e6131.c b/drivers/net/dsa/mv88e6131.c index 310c1cf37830..1a5a15bf16df 100644 --- a/drivers/net/dsa/mv88e6131.c +++ b/drivers/net/dsa/mv88e6131.c | |||
@@ -86,7 +86,6 @@ static int mv88e6131_setup_global(struct dsa_switch *ds) | |||
86 | static int mv88e6131_setup(struct dsa_switch *ds) | 86 | static int mv88e6131_setup(struct dsa_switch *ds) |
87 | { | 87 | { |
88 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); | 88 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
89 | int i; | ||
90 | int ret; | 89 | int ret; |
91 | 90 | ||
92 | ret = mv88e6xxx_setup_common(ds); | 91 | ret = mv88e6xxx_setup_common(ds); |
@@ -118,13 +117,7 @@ static int mv88e6131_setup(struct dsa_switch *ds) | |||
118 | if (ret < 0) | 117 | if (ret < 0) |
119 | return ret; | 118 | return ret; |
120 | 119 | ||
121 | for (i = 0; i < ps->num_ports; i++) { | 120 | return mv88e6xxx_setup_ports(ds); |
122 | ret = mv88e6xxx_setup_port(ds, i); | ||
123 | if (ret < 0) | ||
124 | return ret; | ||
125 | } | ||
126 | |||
127 | return 0; | ||
128 | } | 121 | } |
129 | 122 | ||
130 | static int mv88e6131_port_to_phy_addr(struct dsa_switch *ds, int port) | 123 | static int mv88e6131_port_to_phy_addr(struct dsa_switch *ds, int port) |
diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c index 2b733f0cd6b9..a036d0d15a13 100644 --- a/drivers/net/dsa/mv88e6171.c +++ b/drivers/net/dsa/mv88e6171.c | |||
@@ -69,7 +69,6 @@ static int mv88e6171_setup_global(struct dsa_switch *ds) | |||
69 | static int mv88e6171_setup(struct dsa_switch *ds) | 69 | static int mv88e6171_setup(struct dsa_switch *ds) |
70 | { | 70 | { |
71 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); | 71 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
72 | int i; | ||
73 | int ret; | 72 | int ret; |
74 | 73 | ||
75 | ret = mv88e6xxx_setup_common(ds); | 74 | ret = mv88e6xxx_setup_common(ds); |
@@ -86,16 +85,7 @@ static int mv88e6171_setup(struct dsa_switch *ds) | |||
86 | if (ret < 0) | 85 | if (ret < 0) |
87 | return ret; | 86 | return ret; |
88 | 87 | ||
89 | for (i = 0; i < ps->num_ports; i++) { | 88 | return mv88e6xxx_setup_ports(ds); |
90 | if (!(dsa_is_cpu_port(ds, i) || ds->phys_port_mask & (1 << i))) | ||
91 | continue; | ||
92 | |||
93 | ret = mv88e6xxx_setup_port(ds, i); | ||
94 | if (ret < 0) | ||
95 | return ret; | ||
96 | } | ||
97 | |||
98 | return 0; | ||
99 | } | 89 | } |
100 | 90 | ||
101 | static int mv88e6171_get_eee(struct dsa_switch *ds, int port, | 91 | static int mv88e6171_get_eee(struct dsa_switch *ds, int port, |
diff --git a/drivers/net/dsa/mv88e6352.c b/drivers/net/dsa/mv88e6352.c index b32ec3e9bd6d..41d113749878 100644 --- a/drivers/net/dsa/mv88e6352.c +++ b/drivers/net/dsa/mv88e6352.c | |||
@@ -136,7 +136,6 @@ static int mv88e6352_setup(struct dsa_switch *ds) | |||
136 | { | 136 | { |
137 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); | 137 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
138 | int ret; | 138 | int ret; |
139 | int i; | ||
140 | 139 | ||
141 | ret = mv88e6xxx_setup_common(ds); | 140 | ret = mv88e6xxx_setup_common(ds); |
142 | if (ret < 0) | 141 | if (ret < 0) |
@@ -154,13 +153,7 @@ static int mv88e6352_setup(struct dsa_switch *ds) | |||
154 | if (ret < 0) | 153 | if (ret < 0) |
155 | return ret; | 154 | return ret; |
156 | 155 | ||
157 | for (i = 0; i < ps->num_ports; i++) { | 156 | return mv88e6xxx_setup_ports(ds); |
158 | ret = mv88e6xxx_setup_port(ds, i); | ||
159 | if (ret < 0) | ||
160 | return ret; | ||
161 | } | ||
162 | |||
163 | return 0; | ||
164 | } | 157 | } |
165 | 158 | ||
166 | static int mv88e6352_read_eeprom_word(struct dsa_switch *ds, int addr) | 159 | static int mv88e6352_read_eeprom_word(struct dsa_switch *ds, int addr) |
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index 84496066f21b..f38d8dfa934a 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c | |||
@@ -1309,7 +1309,7 @@ static void mv88e6xxx_bridge_work(struct work_struct *work) | |||
1309 | } | 1309 | } |
1310 | } | 1310 | } |
1311 | 1311 | ||
1312 | int mv88e6xxx_setup_port(struct dsa_switch *ds, int port) | 1312 | static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port) |
1313 | { | 1313 | { |
1314 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); | 1314 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
1315 | int ret, fid; | 1315 | int ret, fid; |
@@ -1548,6 +1548,20 @@ abort: | |||
1548 | return ret; | 1548 | return ret; |
1549 | } | 1549 | } |
1550 | 1550 | ||
1551 | int mv88e6xxx_setup_ports(struct dsa_switch *ds) | ||
1552 | { | ||
1553 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); | ||
1554 | int ret; | ||
1555 | int i; | ||
1556 | |||
1557 | for (i = 0; i < ps->num_ports; i++) { | ||
1558 | ret = mv88e6xxx_setup_port(ds, i); | ||
1559 | if (ret < 0) | ||
1560 | return ret; | ||
1561 | } | ||
1562 | return 0; | ||
1563 | } | ||
1564 | |||
1551 | int mv88e6xxx_setup_common(struct dsa_switch *ds) | 1565 | int mv88e6xxx_setup_common(struct dsa_switch *ds) |
1552 | { | 1566 | { |
1553 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); | 1567 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h index 2aa1a6b31980..46c5ea3801df 100644 --- a/drivers/net/dsa/mv88e6xxx.h +++ b/drivers/net/dsa/mv88e6xxx.h | |||
@@ -336,7 +336,7 @@ struct mv88e6xxx_hw_stat { | |||
336 | }; | 336 | }; |
337 | 337 | ||
338 | int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active); | 338 | int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active); |
339 | int mv88e6xxx_setup_port(struct dsa_switch *ds, int port); | 339 | int mv88e6xxx_setup_ports(struct dsa_switch *ds); |
340 | int mv88e6xxx_setup_common(struct dsa_switch *ds); | 340 | int mv88e6xxx_setup_common(struct dsa_switch *ds); |
341 | int mv88e6xxx_setup_global(struct dsa_switch *ds); | 341 | int mv88e6xxx_setup_global(struct dsa_switch *ds); |
342 | int __mv88e6xxx_reg_read(struct mii_bus *bus, int sw_addr, int addr, int reg); | 342 | int __mv88e6xxx_reg_read(struct mii_bus *bus, int sw_addr, int addr, int reg); |