diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2017-01-03 14:31:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-04 13:29:27 -0500 |
commit | a896eee3349e4e7f35a83f3b1a93c2e048d976b9 (patch) | |
tree | 3b3e750a1ac2f96013eab64e1d80a5bfcf2bc396 /net/dsa/dsa.c | |
parent | 9feb16ae0b2d5246e20a8dd9049441780e59c2a1 (diff) |
net: dsa: remove out label in dsa_switch_setup_one
The "out" label in dsa_switch_setup_one() is useless, thus remove it.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r-- | net/dsa/dsa.c | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 7899919cd9f0..89e66b623d73 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c | |||
@@ -329,8 +329,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) | |||
329 | if (dst->cpu_switch != -1) { | 329 | if (dst->cpu_switch != -1) { |
330 | netdev_err(dst->master_netdev, | 330 | netdev_err(dst->master_netdev, |
331 | "multiple cpu ports?!\n"); | 331 | "multiple cpu ports?!\n"); |
332 | ret = -EINVAL; | 332 | return -EINVAL; |
333 | goto out; | ||
334 | } | 333 | } |
335 | dst->cpu_switch = index; | 334 | dst->cpu_switch = index; |
336 | dst->cpu_port = i; | 335 | dst->cpu_port = i; |
@@ -343,10 +342,8 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) | |||
343 | valid_name_found = true; | 342 | valid_name_found = true; |
344 | } | 343 | } |
345 | 344 | ||
346 | if (!valid_name_found && i == DSA_MAX_PORTS) { | 345 | if (!valid_name_found && i == DSA_MAX_PORTS) |
347 | ret = -EINVAL; | 346 | return -EINVAL; |
348 | goto out; | ||
349 | } | ||
350 | 347 | ||
351 | /* Make the built-in MII bus mask match the number of ports, | 348 | /* Make the built-in MII bus mask match the number of ports, |
352 | * switch drivers can override this later | 349 | * switch drivers can override this later |
@@ -363,10 +360,8 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) | |||
363 | 360 | ||
364 | tag_protocol = ops->get_tag_protocol(ds); | 361 | tag_protocol = ops->get_tag_protocol(ds); |
365 | dst->tag_ops = dsa_resolve_tag_protocol(tag_protocol); | 362 | dst->tag_ops = dsa_resolve_tag_protocol(tag_protocol); |
366 | if (IS_ERR(dst->tag_ops)) { | 363 | if (IS_ERR(dst->tag_ops)) |
367 | ret = PTR_ERR(dst->tag_ops); | 364 | return PTR_ERR(dst->tag_ops); |
368 | goto out; | ||
369 | } | ||
370 | 365 | ||
371 | dst->rcv = dst->tag_ops->rcv; | 366 | dst->rcv = dst->tag_ops->rcv; |
372 | } | 367 | } |
@@ -378,25 +373,23 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) | |||
378 | */ | 373 | */ |
379 | ret = ops->setup(ds); | 374 | ret = ops->setup(ds); |
380 | if (ret < 0) | 375 | if (ret < 0) |
381 | goto out; | 376 | return ret; |
382 | 377 | ||
383 | if (ops->set_addr) { | 378 | if (ops->set_addr) { |
384 | ret = ops->set_addr(ds, dst->master_netdev->dev_addr); | 379 | ret = ops->set_addr(ds, dst->master_netdev->dev_addr); |
385 | if (ret < 0) | 380 | if (ret < 0) |
386 | goto out; | 381 | return ret; |
387 | } | 382 | } |
388 | 383 | ||
389 | if (!ds->slave_mii_bus && ops->phy_read) { | 384 | if (!ds->slave_mii_bus && ops->phy_read) { |
390 | ds->slave_mii_bus = devm_mdiobus_alloc(parent); | 385 | ds->slave_mii_bus = devm_mdiobus_alloc(parent); |
391 | if (!ds->slave_mii_bus) { | 386 | if (!ds->slave_mii_bus) |
392 | ret = -ENOMEM; | 387 | return -ENOMEM; |
393 | goto out; | ||
394 | } | ||
395 | dsa_slave_mii_bus_init(ds); | 388 | dsa_slave_mii_bus_init(ds); |
396 | 389 | ||
397 | ret = mdiobus_register(ds->slave_mii_bus); | 390 | ret = mdiobus_register(ds->slave_mii_bus); |
398 | if (ret < 0) | 391 | if (ret < 0) |
399 | goto out; | 392 | return ret; |
400 | } | 393 | } |
401 | 394 | ||
402 | /* | 395 | /* |
@@ -409,20 +402,16 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) | |||
409 | continue; | 402 | continue; |
410 | 403 | ||
411 | ret = dsa_slave_create(ds, parent, i, cd->port_names[i]); | 404 | ret = dsa_slave_create(ds, parent, i, cd->port_names[i]); |
412 | if (ret < 0) { | 405 | if (ret < 0) |
413 | netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s): %d\n", | 406 | netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s): %d\n", |
414 | index, i, cd->port_names[i], ret); | 407 | index, i, cd->port_names[i], ret); |
415 | ret = 0; | ||
416 | } | ||
417 | } | 408 | } |
418 | 409 | ||
419 | /* Perform configuration of the CPU and DSA ports */ | 410 | /* Perform configuration of the CPU and DSA ports */ |
420 | ret = dsa_cpu_dsa_setups(ds, parent); | 411 | ret = dsa_cpu_dsa_setups(ds, parent); |
421 | if (ret < 0) { | 412 | if (ret < 0) |
422 | netdev_err(dst->master_netdev, "[%d] : can't configure CPU and DSA ports\n", | 413 | netdev_err(dst->master_netdev, "[%d] : can't configure CPU and DSA ports\n", |
423 | index); | 414 | index); |
424 | ret = 0; | ||
425 | } | ||
426 | 415 | ||
427 | ret = dsa_cpu_port_ethtool_setup(ds); | 416 | ret = dsa_cpu_port_ethtool_setup(ds); |
428 | if (ret) | 417 | if (ret) |
@@ -453,10 +442,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) | |||
453 | } | 442 | } |
454 | #endif /* CONFIG_NET_DSA_HWMON */ | 443 | #endif /* CONFIG_NET_DSA_HWMON */ |
455 | 444 | ||
456 | return ret; | 445 | return 0; |
457 | |||
458 | out: | ||
459 | return ret; | ||
460 | } | 446 | } |
461 | 447 | ||
462 | static struct dsa_switch * | 448 | static struct dsa_switch * |