]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/r8169.c
r8169: fix early spinlock use
[linux-2.6-omap-h63xx.git] / drivers / net / r8169.c
index 3c6e591326fc6f9e91d4d07679670c3af06d3464..59fbc64d7c479636b033b60f8dc6e4a44046423c 100644 (file)
@@ -759,6 +759,7 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
                tp->features |= RTL_FEATURE_WOL;
        else
                tp->features &= ~RTL_FEATURE_WOL;
+       device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
 
        spin_unlock_irq(&tp->lock);
 
@@ -1951,7 +1952,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                dev->do_ioctl = rtl8169_ioctl;
        }
 
-       /* Read MAC address from EEPROM */
+       spin_lock_init(&tp->lock);
+
        rtl_init_mac_address(tp, ioaddr);
 
        /* Get MAC address */
@@ -1994,8 +1996,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        tp->timer.data = (unsigned long) dev;
        tp->timer.function = rtl8169_phy_timer;
 
-       spin_lock_init(&tp->lock);
-
        rc = register_netdev(dev);
        if (rc < 0)
                goto err_out_msi_5;
@@ -2017,6 +2017,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
 
        rtl8169_init_phy(dev, tp);
+       device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);
 
 out:
        return rc;