diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2022-08-19 20:48:13 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2022-08-23 11:39:22 +0200 |
commit | 0498277ee17bb40cef43e0c9064b06c25f9bda29 (patch) | |
tree | 2c6de22016a0ded3e022b9be222f2b528f678627 | |
parent | 4c3f80d22b2eca911143ce656fa45c4699ff5bf4 (diff) | |
download | linux-0498277ee17bb40cef43e0c9064b06c25f9bda29.tar.bz2 |
net: dsa: don't stop at NOTIFY_OK when calling ds->ops->port_prechangeupper
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>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r-- | net/dsa/slave.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 3157da2adf6b..85cffd844364 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -2710,7 +2710,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); |