alx: fix lockdep annotation
Move spin_lock_init to be called before the spinlocks are used, preventing a lockdep splat. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f89e57c4f5
commit
a8798a5c77
|
@ -1245,6 +1245,8 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
|
|
||||||
SET_NETDEV_DEV(netdev, &pdev->dev);
|
SET_NETDEV_DEV(netdev, &pdev->dev);
|
||||||
alx = netdev_priv(netdev);
|
alx = netdev_priv(netdev);
|
||||||
|
spin_lock_init(&alx->hw.mdio_lock);
|
||||||
|
spin_lock_init(&alx->irq_lock);
|
||||||
alx->dev = netdev;
|
alx->dev = netdev;
|
||||||
alx->hw.pdev = pdev;
|
alx->hw.pdev = pdev;
|
||||||
alx->msg_enable = NETIF_MSG_LINK | NETIF_MSG_HW | NETIF_MSG_IFUP |
|
alx->msg_enable = NETIF_MSG_LINK | NETIF_MSG_HW | NETIF_MSG_IFUP |
|
||||||
|
@ -1327,9 +1329,6 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
|
|
||||||
INIT_WORK(&alx->link_check_wk, alx_link_check);
|
INIT_WORK(&alx->link_check_wk, alx_link_check);
|
||||||
INIT_WORK(&alx->reset_wk, alx_reset);
|
INIT_WORK(&alx->reset_wk, alx_reset);
|
||||||
spin_lock_init(&alx->hw.mdio_lock);
|
|
||||||
spin_lock_init(&alx->irq_lock);
|
|
||||||
|
|
||||||
netif_carrier_off(netdev);
|
netif_carrier_off(netdev);
|
||||||
|
|
||||||
err = register_netdev(netdev);
|
err = register_netdev(netdev);
|
||||||
|
|
Loading…
Reference in New Issue