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>
This commit is contained in:

committed by
David S. Miller

parent
f561986659
commit
cd8d7dd41b
@@ -433,11 +433,9 @@ static int dsa_dst_apply(struct dsa_switch_tree *dst)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dst->cpu_dp) {
|
err = dsa_cpu_port_ethtool_setup(dst->cpu_dp);
|
||||||
err = dsa_cpu_port_ethtool_setup(dst->cpu_dp);
|
if (err)
|
||||||
if (err)
|
return err;
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If we use a tagging format that doesn't have an ethertype
|
/* If we use a tagging format that doesn't have an ethertype
|
||||||
* field, make sure that all packets from this point on get
|
* 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);
|
dsa_ds_unapply(dst, ds);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dst->cpu_dp) {
|
dsa_cpu_port_ethtool_restore(dst->cpu_dp);
|
||||||
dsa_cpu_port_ethtool_restore(dst->cpu_dp);
|
dst->cpu_dp = NULL;
|
||||||
dst->cpu_dp = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
pr_info("DSA: tree %d unapplied\n", dst->tree);
|
pr_info("DSA: tree %d unapplied\n", dst->tree);
|
||||||
dst->applied = false;
|
dst->applied = false;
|
||||||
|
Reference in New Issue
Block a user