kernel: update kernel 3.18 to version 3.18.23
[openwrt/staging/chunkeey.git] / target / linux / generic / patches-3.18 / 070-bgmac-register-napi-before-the-device.patch
1 From 6216642f200258708e47170ff14ba8ecb486f4f0 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sun, 18 Jan 2015 19:49:58 +0100
4 Subject: [PATCH] bgmac: register napi before the device
5
6 napi should get registered before the netdev and not after.
7
8 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
9 Signed-off-by: David S. Miller <davem@davemloft.net>
10 ---
11 drivers/net/ethernet/broadcom/bgmac.c | 6 +++---
12 1 file changed, 3 insertions(+), 3 deletions(-)
13
14 --- a/drivers/net/ethernet/broadcom/bgmac.c
15 +++ b/drivers/net/ethernet/broadcom/bgmac.c
16 @@ -1515,6 +1515,8 @@ static int bgmac_probe(struct bcma_devic
17 if (core->bus->sprom.boardflags_lo & BGMAC_BFL_ENETADM)
18 bgmac_warn(bgmac, "Support for ADMtek ethernet switch not implemented\n");
19
20 + netif_napi_add(net_dev, &bgmac->napi, bgmac_poll, BGMAC_WEIGHT);
21 +
22 err = bgmac_mii_register(bgmac);
23 if (err) {
24 bgmac_err(bgmac, "Cannot register MDIO\n");
25 @@ -1529,8 +1531,6 @@ static int bgmac_probe(struct bcma_devic
26
27 netif_carrier_off(net_dev);
28
29 - netif_napi_add(net_dev, &bgmac->napi, bgmac_poll, BGMAC_WEIGHT);
30 -
31 return 0;
32
33 err_mii_unregister:
34 @@ -1549,9 +1549,9 @@ static void bgmac_remove(struct bcma_dev
35 {
36 struct bgmac *bgmac = bcma_get_drvdata(core);
37
38 - netif_napi_del(&bgmac->napi);
39 unregister_netdev(bgmac->net_dev);
40 bgmac_mii_unregister(bgmac);
41 + netif_napi_del(&bgmac->napi);
42 bgmac_dma_free(bgmac);
43 bcma_set_drvdata(core, NULL);
44 free_netdev(bgmac->net_dev);