diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2017-09-19 17:56:58 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-20 01:04:23 +0200 |
commit | cd8d7dd41bfddaa02e34db35abfab14ce4584dee (patch) | |
tree | b530ea3ce0d3761bbcb49700c12289373eaa2ed2 /net/dsa/dsa2.c | |
parent | net: dsa: remove copy of master ethtool_ops (diff) | |
download | linux-cd8d7dd41bfddaa02e34db35abfab14ce4584dee.tar.xz linux-cd8d7dd41bfddaa02e34db35abfab14ce4584dee.zip |
net: dsa: setup master ethtool unconditionally
When a DSA switch tree is meant to be applied, it already has a CPU
port. Thus remove the condition of dst->cpu_dp.
Moreover, the next lines access dst->cpu_dp unconditionally.
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 '')
-rw-r--r-- | net/dsa/dsa2.c | 14 |
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) return err; } - if (dst->cpu_dp) { - err = dsa_cpu_port_ethtool_setup(dst->cpu_dp); - if (err) - return err; - } + err = dsa_cpu_port_ethtool_setup(dst->cpu_dp); + if (err) + return err; /* If we use a tagging format that doesn't have an ethertype * 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) dsa_ds_unapply(dst, ds); } - if (dst->cpu_dp) { - dsa_cpu_port_ethtool_restore(dst->cpu_dp); - dst->cpu_dp = NULL; - } + dsa_cpu_port_ethtool_restore(dst->cpu_dp); + dst->cpu_dp = NULL; pr_info("DSA: tree %d unapplied\n", dst->tree); dst->applied = false; |