net: dsa: mv88e6xxx: silently skip PVT ops

Since mv88e6xxx_pvt_map is a static helper, no need to return
-EOPNOTSUPP if the chip has no PVT, simply silently skip the operation.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
This commit is contained in:
Vivien Didelot 2019-10-21 16:51:25 -04:00 committed by Jakub Kicinski
parent da4561cda2
commit d14939be8b
1 changed files with 1 additions and 10 deletions

View File

@ -1253,7 +1253,7 @@ static int mv88e6xxx_pvt_map(struct mv88e6xxx_chip *chip, int dev, int port)
u16 pvlan = 0; u16 pvlan = 0;
if (!mv88e6xxx_has_pvt(chip)) if (!mv88e6xxx_has_pvt(chip))
return -EOPNOTSUPP; return 0;
/* Skip the local source device, which uses in-chip port VLAN */ /* Skip the local source device, which uses in-chip port VLAN */
if (dev != chip->ds->index) if (dev != chip->ds->index)
@ -2049,9 +2049,6 @@ static int mv88e6xxx_bridge_map(struct mv88e6xxx_chip *chip,
} }
} }
if (!mv88e6xxx_has_pvt(chip))
return 0;
/* Remap the Port VLAN of each cross-chip bridge group member */ /* Remap the Port VLAN of each cross-chip bridge group member */
for (dev = 0; dev < DSA_MAX_SWITCHES; ++dev) { for (dev = 0; dev < DSA_MAX_SWITCHES; ++dev) {
ds = chip->ds->dst->ds[dev]; ds = chip->ds->dst->ds[dev];
@ -2101,9 +2098,6 @@ static int mv88e6xxx_crosschip_bridge_join(struct dsa_switch *ds, int dev,
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
if (!mv88e6xxx_has_pvt(chip))
return 0;
mv88e6xxx_reg_lock(chip); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_pvt_map(chip, dev, port); err = mv88e6xxx_pvt_map(chip, dev, port);
mv88e6xxx_reg_unlock(chip); mv88e6xxx_reg_unlock(chip);
@ -2116,9 +2110,6 @@ static void mv88e6xxx_crosschip_bridge_leave(struct dsa_switch *ds, int dev,
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
if (!mv88e6xxx_has_pvt(chip))
return;
mv88e6xxx_reg_lock(chip); mv88e6xxx_reg_lock(chip);
if (mv88e6xxx_pvt_map(chip, dev, port)) if (mv88e6xxx_pvt_map(chip, dev, port))
dev_err(ds->dev, "failed to remap cross-chip Port VLAN\n"); dev_err(ds->dev, "failed to remap cross-chip Port VLAN\n");