goto out;
reg = qca8k_read(priv, QCA8K_REG_VTU_FUNC0);
- if (reg < 0)
- return reg;
+ if (reg < 0) {
+ ret = reg;
+ goto out;
+ }
reg |= QCA8K_VTU_FUNC0_VALID | QCA8K_VTU_FUNC0_IVL_EN;
reg &= ~(QCA8K_VTU_FUNC0_EG_MODE_MASK << QCA8K_VTU_FUNC0_EG_MODE_S(port));
if (untagged)
ret = qca8k_write(priv, QCA8K_REG_VTU_FUNC0, reg);
if (ret)
- return ret;
+ goto out;
ret = qca8k_vlan_access(priv, QCA8K_VLAN_LOAD, vid);
out:
goto out;
reg = qca8k_read(priv, QCA8K_REG_VTU_FUNC0);
- if (reg < 0)
- return reg;
+ if (reg < 0) {
+ ret = reg;
+ goto out;
+ }
reg &= ~(3 << QCA8K_VTU_FUNC0_EG_MODE_S(port));
reg |= QCA8K_VTU_FUNC0_EG_MODE_NOT <<
QCA8K_VTU_FUNC0_EG_MODE_S(port);
} else {
ret = qca8k_write(priv, QCA8K_REG_VTU_FUNC0, reg);
if (ret)
- return ret;
+ goto out;
ret = qca8k_vlan_access(priv, QCA8K_VLAN_LOAD, vid);
}