Skip to content

Commit

Permalink
net: dsa: mt7530: drop paranoid checks in .get_tag_protocol()
Browse files Browse the repository at this point in the history
It is desirable to reduce the surface of DSA_TAG_PROTO_NONE as much as
we can, because we now have options for switches without hardware
support for DSA tagging, and the occurrence in the mt7530 driver is in
fact quite gratuitout and easy to remove. Since ds->ops->get_tag_protocol()
is only called for CPU ports, the checks for a CPU port in
mtk_get_tag_protocol() are redundant and can be removed.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: DENG Qingfang <dqfext@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vladimir Oltean authored and David S. Miller committed Aug 2, 2021
1 parent a3280ef commit 244f8a8
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions drivers/net/dsa/mt7530.c
Original file line number Diff line number Diff line change
Expand Up @@ -1717,15 +1717,7 @@ static enum dsa_tag_protocol
mtk_get_tag_protocol(struct dsa_switch *ds, int port,
enum dsa_tag_protocol mp)
{
struct mt7530_priv *priv = ds->priv;

if (port != MT7530_CPU_PORT) {
dev_warn(priv->dev,
"port not matched with tagging CPU port\n");
return DSA_TAG_PROTO_NONE;
} else {
return DSA_TAG_PROTO_MTK;
}
return DSA_TAG_PROTO_MTK;
}

#ifdef CONFIG_GPIOLIB
Expand Down

0 comments on commit 244f8a8

Please sign in to comment.