1 From e35e9d1a3dd2cc4f06f03ec4c3fae781bb0c5075 Mon Sep 17 00:00:00 2001
2 From: Ioana Ciornei <ioana.ciornei@nxp.com>
3 Date: Mon, 11 Nov 2019 18:50:56 +0200
4 Subject: [PATCH] staging: dpaa2-ethsw: move port switchdev notifier per ethsw
6 Register a different switchdev notifier block per ethsw instance.
7 When probing multiple dpaa2-ethsw instances, without this the register
10 Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
11 Link: https://lore.kernel.org/r/1573491058-24766-3-git-send-email-ioana.ciornei@nxp.com
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14 drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 11 ++++-------
15 drivers/staging/fsl-dpaa2/ethsw/ethsw.h | 1 +
16 2 files changed, 5 insertions(+), 7 deletions(-)
18 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
19 +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
20 @@ -1314,10 +1314,6 @@ static int port_switchdev_blocking_event
24 -static struct notifier_block port_switchdev_nb = {
25 - .notifier_call = port_switchdev_event,
28 static struct notifier_block port_switchdev_blocking_nb = {
29 .notifier_call = port_switchdev_blocking_event,
31 @@ -1334,7 +1330,8 @@ static int ethsw_register_notifier(struc
35 - err = register_switchdev_notifier(&port_switchdev_nb);
36 + ethsw->port_switchdev_nb.notifier_call = port_switchdev_event;
37 + err = register_switchdev_notifier(ðsw->port_switchdev_nb);
39 dev_err(dev, "Failed to register switchdev notifier\n");
40 goto err_switchdev_nb;
41 @@ -1349,7 +1346,7 @@ static int ethsw_register_notifier(struc
44 err_switchdev_blocking_nb:
45 - unregister_switchdev_notifier(&port_switchdev_nb);
46 + unregister_switchdev_notifier(ðsw->port_switchdev_nb);
48 unregister_netdevice_notifier(ðsw->port_nb);
50 @@ -1499,7 +1496,7 @@ static void ethsw_unregister_notifier(st
52 "Failed to unregister switchdev blocking notifier (%d)\n", err);
54 - err = unregister_switchdev_notifier(&port_switchdev_nb);
55 + err = unregister_switchdev_notifier(ðsw->port_switchdev_nb);
58 "Failed to unregister switchdev notifier (%d)\n", err);
59 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.h
60 +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.h
61 @@ -68,6 +68,7 @@ struct ethsw_core {
64 struct notifier_block port_nb;
65 + struct notifier_block port_switchdev_nb;
68 #endif /* __ETHSW_H */