summaryrefslogtreecommitdiffstats
path: root/net/bridge/br_sysfs_if.c
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-02-12 16:15:53 +0100
committerDavid S. Miller <davem@davemloft.net>2021-02-13 02:08:04 +0100
commit078bbb851ea6c1dbc95da272daf0a68b06a3c164 (patch)
treeb2369d5e1d2064b1793fc6af8de038edffa4d289 /net/bridge/br_sysfs_if.c
parentnet: bridge: offload all port flags at once in br_setport (diff)
downloadlinux-078bbb851ea6c1dbc95da272daf0a68b06a3c164.tar.xz
linux-078bbb851ea6c1dbc95da272daf0a68b06a3c164.zip
net: bridge: don't print in br_switchdev_set_port_flag
For the netlink interface, propagate errors through extack rather than simply printing them to the console. For the sysfs interface, we still print to the console, but at least that's one layer higher than in switchdev, which also allows us to silently ignore the offloading of flags if that is ever needed in the future. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_sysfs_if.c')
-rw-r--r--net/bridge/br_sysfs_if.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
index 5aea9427ffe1..72e92376eef1 100644
--- a/net/bridge/br_sysfs_if.c
+++ b/net/bridge/br_sysfs_if.c
@@ -59,6 +59,7 @@ static BRPORT_ATTR(_name, 0644, \
static int store_flag(struct net_bridge_port *p, unsigned long v,
unsigned long mask)
{
+ struct netlink_ext_ack extack = {0};
unsigned long flags = p->flags;
int err;
@@ -68,9 +69,11 @@ static int store_flag(struct net_bridge_port *p, unsigned long v,
flags &= ~mask;
if (flags != p->flags) {
- err = br_switchdev_set_port_flag(p, flags, mask);
- if (err)
+ err = br_switchdev_set_port_flag(p, flags, mask, &extack);
+ if (err) {
+ netdev_err(p->dev, "%s\n", extack._msg);
return err;
+ }
p->flags = flags;
br_port_flags_change(p, mask);