Skip to content

Commit 123338d

Browse files
vladimirolteandavem330
authored andcommitted
net: dpaa2-switch: use extack in dpaa2_switch_port_bridge_join
We need to propagate the extack argument for dpaa2_switch_port_bridge_join to use it in a future patch, and it looks like there is already an error message there which is currently printed to the console. Move it over netlink so it is properly transmitted to user space. Cc: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com> Acked-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c2255ff commit 123338d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,8 @@ static int dpaa2_switch_port_attr_set_event(struct net_device *netdev,
18901890
}
18911891

18921892
static int dpaa2_switch_port_bridge_join(struct net_device *netdev,
1893-
struct net_device *upper_dev)
1893+
struct net_device *upper_dev,
1894+
struct netlink_ext_ack *extack)
18941895
{
18951896
struct ethsw_port_priv *port_priv = netdev_priv(netdev);
18961897
struct ethsw_core *ethsw = port_priv->ethsw_data;
@@ -1906,8 +1907,8 @@ static int dpaa2_switch_port_bridge_join(struct net_device *netdev,
19061907

19071908
other_port_priv = netdev_priv(other_dev);
19081909
if (other_port_priv->ethsw_data != port_priv->ethsw_data) {
1909-
netdev_err(netdev,
1910-
"Interface from a different DPSW is in the bridge already!\n");
1910+
NL_SET_ERR_MSG_MOD(extack,
1911+
"Interface from a different DPSW is in the bridge already");
19111912
return -EINVAL;
19121913
}
19131914
}
@@ -2067,7 +2068,9 @@ static int dpaa2_switch_port_netdevice_event(struct notifier_block *nb,
20672068
upper_dev = info->upper_dev;
20682069
if (netif_is_bridge_master(upper_dev)) {
20692070
if (info->linking)
2070-
err = dpaa2_switch_port_bridge_join(netdev, upper_dev);
2071+
err = dpaa2_switch_port_bridge_join(netdev,
2072+
upper_dev,
2073+
extack);
20712074
else
20722075
err = dpaa2_switch_port_bridge_leave(netdev);
20732076
}

0 commit comments

Comments
 (0)