summaryrefslogtreecommitdiffstats
path: root/net/dsa/dsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r--net/dsa/dsa.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 2173402d87e0..fc1813140be6 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -314,19 +314,15 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
314 * Create network devices for physical switch ports. 314 * Create network devices for physical switch ports.
315 */ 315 */
316 for (i = 0; i < DSA_MAX_PORTS; i++) { 316 for (i = 0; i < DSA_MAX_PORTS; i++) {
317 struct net_device *slave_dev;
318
319 if (!(ds->phys_port_mask & (1 << i))) 317 if (!(ds->phys_port_mask & (1 << i)))
320 continue; 318 continue;
321 319
322 slave_dev = dsa_slave_create(ds, parent, i, pd->port_names[i]); 320 ret = dsa_slave_create(ds, parent, i, pd->port_names[i]);
323 if (slave_dev == NULL) { 321 if (ret < 0) {
324 netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s)\n", 322 netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s)\n",
325 index, i, pd->port_names[i]); 323 index, i, pd->port_names[i]);
326 continue; 324 ret = 0;
327 } 325 }
328
329 ds->ports[i] = slave_dev;
330 } 326 }
331 327
332#ifdef CONFIG_NET_DSA_HWMON 328#ifdef CONFIG_NET_DSA_HWMON