Commit 543ba01d authored by Razvan Stefanescu's avatar Razvan Stefanescu Committed by Greg Kroah-Hartman

staging: fsl-dpaa2/ethsw: Fix setting port learning/flooding flags

ethsw_set_learning()/ethsw_set_flood() use flags parameter as an
enable/disable (1/0) indicator. Previous usage sent incorrect values.
Signed-off-by: default avatarRazvan Stefanescu <razvan.stefanescu@nxp.com>
Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/1562336836-17119-2-git-send-email-ioana.ciornei@nxp.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 26a7ae29
......@@ -673,11 +673,12 @@ static int port_attr_br_flags_set(struct net_device *netdev,
return 0;
/* Learning is enabled per switch */
err = ethsw_set_learning(port_priv->ethsw_data, flags & BR_LEARNING);
err = ethsw_set_learning(port_priv->ethsw_data,
!!(flags & BR_LEARNING));
if (err)
goto exit;
err = ethsw_port_set_flood(port_priv, flags & BR_FLOOD);
err = ethsw_port_set_flood(port_priv, !!(flags & BR_FLOOD));
exit:
return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment