Message ID | 20220523104256.3556016-4-olteanv@gmail.com (mailing list archive) |
---|---|
State | RFC |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | DSA changes for multiple CPU ports (part 3) | expand |
On 5/23/22 03:42, Vladimir Oltean wrote: > From: Vladimir Oltean <vladimir.oltean@nxp.com> > > dsa_slave_prechangeupper_sanity_check() is supposed to enforce some > adjacency restrictions, and calls ds->ops->port_prechangeupper if the > driver implements it. > > We convert the error code from the port_prechangeupper() call to a > notifier code, and 0 is converted to NOTIFY_OK, but the caller of > dsa_slave_prechangeupper_sanity_check() stops at any notifier code > different from NOTIFY_DONE. > > Avoid this by converting back the notifier code to an error code, so > that both NOTIFY_OK and NOTIFY_DONE will be seen as 0. This allows more > parallel sanity check functions to be added. > > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 8d62c634c331..d8768e8f7862 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -2685,7 +2685,7 @@ static int dsa_slave_netdevice_event(struct notifier_block *nb, int err; err = dsa_slave_prechangeupper_sanity_check(dev, info); - if (err != NOTIFY_DONE) + if (notifier_to_errno(err)) return err; err = dsa_slave_prechangeupper(dev, ptr);