1 From e6987a7f7ebbde64eb679f10a6eb857b9e28d05d Mon Sep 17 00:00:00 2001
2 From: Ioana Ciornei <ioana.ciornei@nxp.com>
3 Date: Mon, 11 Nov 2019 18:50:57 +0200
4 Subject: [PATCH] staging: dpaa2-ethsw: move port switchdev blocking notifier
7 Register a different switchdev blocking notifier block per ethsw
8 instance. When probing multiple dpaa2-ethsw instances, without this the
11 Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
12 Link: https://lore.kernel.org/r/1573491058-24766-4-git-send-email-ioana.ciornei@nxp.com
13 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 9 +++------
16 drivers/staging/fsl-dpaa2/ethsw/ethsw.h | 1 +
17 2 files changed, 4 insertions(+), 6 deletions(-)
19 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
20 +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
21 @@ -1314,10 +1314,6 @@ static int port_switchdev_blocking_event
25 -static struct notifier_block port_switchdev_blocking_nb = {
26 - .notifier_call = port_switchdev_blocking_event,
29 static int ethsw_register_notifier(struct device *dev)
31 struct ethsw_core *ethsw = dev_get_drvdata(dev);
32 @@ -1337,7 +1333,8 @@ static int ethsw_register_notifier(struc
33 goto err_switchdev_nb;
36 - err = register_switchdev_blocking_notifier(&port_switchdev_blocking_nb);
37 + ethsw->port_switchdevb_nb.notifier_call = port_switchdev_blocking_event;
38 + err = register_switchdev_blocking_notifier(ðsw->port_switchdevb_nb);
40 dev_err(dev, "Failed to register switchdev blocking notifier\n");
41 goto err_switchdev_blocking_nb;
42 @@ -1490,7 +1487,7 @@ static void ethsw_unregister_notifier(st
43 struct notifier_block *nb;
46 - nb = &port_switchdev_blocking_nb;
47 + nb = ðsw->port_switchdevb_nb;
48 err = unregister_switchdev_blocking_notifier(nb);
51 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.h
52 +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.h
53 @@ -69,6 +69,7 @@ struct ethsw_core {
55 struct notifier_block port_nb;
56 struct notifier_block port_switchdev_nb;
57 + struct notifier_block port_switchdevb_nb;
60 #endif /* __ETHSW_H */