layerscape: add ls1088ardb device support
[openwrt/staging/lynxis/omap.git] / target / linux / layerscape / patches-4.4 / 7210-staging-fsl-dpaa2-mac-Fix-unregister_netdev-issue.patch
1 From e74b6010eca026625ba4e39c80620320ca777deb Mon Sep 17 00:00:00 2001
2 From: Ioana Radulescu <ruxandra.radulescu@nxp.com>
3 Date: Tue, 5 Apr 2016 13:35:14 +0300
4 Subject: [PATCH 210/226] staging: fsl-dpaa2/mac: Fix unregister_netdev issue
5
6 We only register the netdevice associated with a mac object if
7 ONFIG_FSL_DPAA2_MAC_NETDEV is set, but we always unregister it
8 during device remove(). Fix this by ifdef-ing the unregister
9 operation.
10
11 Also ifdef the change in netdevice name as it only makes sense
12 under this option.
13
14 Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
15 (cherry picked from commit dd6a5313e194168d46fef495a6e3bc5207801473)
16 ---
17 drivers/staging/fsl-dpaa2/mac/mac.c | 5 +++++
18 1 file changed, 5 insertions(+)
19
20 --- a/drivers/staging/fsl-dpaa2/mac/mac.c
21 +++ b/drivers/staging/fsl-dpaa2/mac/mac.c
22 @@ -534,7 +534,10 @@ static int dpaa2_mac_probe(struct fsl_mc
23 priv->netdev = netdev;
24
25 SET_NETDEV_DEV(netdev, dev);
26 +
27 +#ifdef CONFIG_FSL_DPAA2_MAC_NETDEVS
28 snprintf(netdev->name, IFNAMSIZ, "mac%d", mc_dev->obj_desc.id);
29 +#endif
30
31 dev_set_drvdata(dev, priv);
32
33 @@ -684,7 +687,9 @@ static int dpaa2_mac_remove(struct fsl_m
34 struct device *dev = &mc_dev->dev;
35 struct dpaa2_mac_priv *priv = dev_get_drvdata(dev);
36
37 +#ifdef CONFIG_FSL_DPAA2_MAC_NETDEVS
38 unregister_netdev(priv->netdev);
39 +#endif
40 teardown_irqs(priv->mc_dev);
41 dpmac_close(priv->mc_dev->mc_io, 0, priv->mc_dev->mc_handle);
42 fsl_mc_portal_free(priv->mc_dev->mc_io);