1
0

070-bgmac-register-napi-before-the-device.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. napi should get registered before the netdev and not after.
  6. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  7. Signed-off-by: David S. Miller <davem@davemloft.net>
  8. ---
  9. drivers/net/ethernet/broadcom/bgmac.c | 6 +++---
  10. 1 file changed, 3 insertions(+), 3 deletions(-)
  11. --- a/drivers/net/ethernet/broadcom/bgmac.c
  12. +++ b/drivers/net/ethernet/broadcom/bgmac.c
  13. @@ -1515,6 +1515,8 @@ static int bgmac_probe(struct bcma_devic
  14. if (core->bus->sprom.boardflags_lo & BGMAC_BFL_ENETADM)
  15. bgmac_warn(bgmac, "Support for ADMtek ethernet switch not implemented\n");
  16. + netif_napi_add(net_dev, &bgmac->napi, bgmac_poll, BGMAC_WEIGHT);
  17. +
  18. err = bgmac_mii_register(bgmac);
  19. if (err) {
  20. bgmac_err(bgmac, "Cannot register MDIO\n");
  21. @@ -1529,8 +1531,6 @@ static int bgmac_probe(struct bcma_devic
  22. netif_carrier_off(net_dev);
  23. - netif_napi_add(net_dev, &bgmac->napi, bgmac_poll, BGMAC_WEIGHT);
  24. -
  25. return 0;
  26. err_mii_unregister:
  27. @@ -1549,9 +1549,9 @@ static void bgmac_remove(struct bcma_dev
  28. {
  29. struct bgmac *bgmac = bcma_get_drvdata(core);
  30. - netif_napi_del(&bgmac->napi);
  31. unregister_netdev(bgmac->net_dev);
  32. bgmac_mii_unregister(bgmac);
  33. + netif_napi_del(&bgmac->napi);
  34. bgmac_dma_free(bgmac);
  35. bcma_set_drvdata(core, NULL);
  36. free_netdev(bgmac->net_dev);