aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/dsa2.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dsa/dsa2.c')
-rw-r--r--net/dsa/dsa2.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 873af0108e24..bd19304f862f 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -433,11 +433,9 @@ static int dsa_dst_apply(struct dsa_switch_tree *dst)
433 return err; 433 return err;
434 } 434 }
435 435
436 if (dst->cpu_dp) { 436 err = dsa_cpu_port_ethtool_setup(dst->cpu_dp);
437 err = dsa_cpu_port_ethtool_setup(dst->cpu_dp); 437 if (err)
438 if (err) 438 return err;
439 return err;
440 }
441 439
442 /* If we use a tagging format that doesn't have an ethertype 440 /* If we use a tagging format that doesn't have an ethertype
443 * field, make sure that all packets from this point on get 441 * field, make sure that all packets from this point on get
@@ -474,10 +472,8 @@ static void dsa_dst_unapply(struct dsa_switch_tree *dst)
474 dsa_ds_unapply(dst, ds); 472 dsa_ds_unapply(dst, ds);
475 } 473 }
476 474
477 if (dst->cpu_dp) { 475 dsa_cpu_port_ethtool_restore(dst->cpu_dp);
478 dsa_cpu_port_ethtool_restore(dst->cpu_dp); 476 dst->cpu_dp = NULL;
479 dst->cpu_dp = NULL;
480 }
481 477
482 pr_info("DSA: tree %d unapplied\n", dst->tree); 478 pr_info("DSA: tree %d unapplied\n", dst->tree);
483 dst->applied = false; 479 dst->applied = false;