diff options
author | 2021-02-13 22:43:18 +0200 | |
---|---|---|
committer | 2021-02-14 17:38:11 -0800 | |
commit | 31046a5fd92c57d99e8861f3dc56a2584787b473 (patch) | |
tree | 95c43c68688376535eb83c805231d55477b0e874 /drivers/net/dsa/microchip | |
parent | net: bridge: propagate extack through switchdev_port_attr_set (diff) | |
download | linux-dev-31046a5fd92c57d99e8861f3dc56a2584787b473.tar.xz linux-dev-31046a5fd92c57d99e8861f3dc56a2584787b473.zip |
net: dsa: propagate extack to .port_vlan_add
Allow drivers to communicate their restrictions to user space directly,
instead of printing to the kernel log. Where the conversion would have
been lossy and things like VLAN ID could no longer be conveyed (due to
the lack of support for printf format specifier in netlink extack), I
chose to keep the messages in full form to the kernel log only, and
leave it up to individual driver maintainers to move more messages to
extack.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/microchip')
-rw-r--r-- | drivers/net/dsa/microchip/ksz8795.c | 3 | ||||
-rw-r--r-- | drivers/net/dsa/microchip/ksz9477.c | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index c87d445b30fd..1e27a3e58141 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -793,7 +793,8 @@ static int ksz8795_port_vlan_filtering(struct dsa_switch *ds, int port, } static int ksz8795_port_vlan_add(struct dsa_switch *ds, int port, - const struct switchdev_obj_port_vlan *vlan) + const struct switchdev_obj_port_vlan *vlan, + struct netlink_ext_ack *extack) { bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; struct ksz_device *dev = ds->priv; diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index 00e38c8e0d01..772e34d5b6b8 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -511,7 +511,8 @@ static int ksz9477_port_vlan_filtering(struct dsa_switch *ds, int port, } static int ksz9477_port_vlan_add(struct dsa_switch *ds, int port, - const struct switchdev_obj_port_vlan *vlan) + const struct switchdev_obj_port_vlan *vlan, + struct netlink_ext_ack *extack) { struct ksz_device *dev = ds->priv; u32 vlan_table[3]; @@ -520,7 +521,7 @@ static int ksz9477_port_vlan_add(struct dsa_switch *ds, int port, err = ksz9477_get_vlan_table(dev, vlan->vid, vlan_table); if (err) { - dev_dbg(dev->dev, "Failed to get vlan table\n"); + NL_SET_ERR_MSG_MOD(extack, "Failed to get vlan table"); return err; } @@ -535,7 +536,7 @@ static int ksz9477_port_vlan_add(struct dsa_switch *ds, int port, err = ksz9477_set_vlan_table(dev, vlan->vid, vlan_table); if (err) { - dev_dbg(dev->dev, "Failed to set vlan table\n"); + NL_SET_ERR_MSG_MOD(extack, "Failed to set vlan table"); return err; } |