Commit 73649d81 authored by kafai0928@yahoo.com's avatar kafai0928@yahoo.com Committed by Jeff Garzik

Use SET_MODULE_OWNER in eepro100 net driver instead of

MOD_{INC,DEC}_USE_COUNT, eliminating a small race
parent 87c4764d
...@@ -658,6 +658,8 @@ static int __devinit speedo_found1(struct pci_dev *pdev, ...@@ -658,6 +658,8 @@ static int __devinit speedo_found1(struct pci_dev *pdev,
return -1; return -1;
} }
SET_MODULE_OWNER(dev);
if (dev->mem_start > 0) if (dev->mem_start > 0)
option = dev->mem_start; option = dev->mem_start;
else if (card_idx >= 0 && options[card_idx] >= 0) else if (card_idx >= 0 && options[card_idx] >= 0)
...@@ -919,7 +921,6 @@ static int mdio_write(long ioaddr, int phy_id, int location, int value) ...@@ -919,7 +921,6 @@ static int mdio_write(long ioaddr, int phy_id, int location, int value)
return val & 0xffff; return val & 0xffff;
} }
static int static int
speedo_open(struct net_device *dev) speedo_open(struct net_device *dev)
{ {
...@@ -930,8 +931,6 @@ speedo_open(struct net_device *dev) ...@@ -930,8 +931,6 @@ speedo_open(struct net_device *dev)
if (speedo_debug > 1) if (speedo_debug > 1)
printk(KERN_DEBUG "%s: speedo_open() irq %d.\n", dev->name, dev->irq); printk(KERN_DEBUG "%s: speedo_open() irq %d.\n", dev->name, dev->irq);
MOD_INC_USE_COUNT;
pci_set_power_state(sp->pdev, 0); pci_set_power_state(sp->pdev, 0);
/* Set up the Tx queue early.. */ /* Set up the Tx queue early.. */
...@@ -945,7 +944,6 @@ speedo_open(struct net_device *dev) ...@@ -945,7 +944,6 @@ speedo_open(struct net_device *dev)
/* .. we can safely take handler calls during init. */ /* .. we can safely take handler calls during init. */
retval = request_irq(dev->irq, &speedo_interrupt, SA_SHIRQ, dev->name, dev); retval = request_irq(dev->irq, &speedo_interrupt, SA_SHIRQ, dev->name, dev);
if (retval) { if (retval) {
MOD_DEC_USE_COUNT;
return retval; return retval;
} }
...@@ -1886,8 +1884,6 @@ speedo_close(struct net_device *dev) ...@@ -1886,8 +1884,6 @@ speedo_close(struct net_device *dev)
pci_set_power_state(sp->pdev, 2); pci_set_power_state(sp->pdev, 2);
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment