Commit 718aca7f authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] unregister_netdev cleanups

Replace

	rtnl_lock();
	register_netdevice(dev);
	rtnl_unlock();

with the equivalent

	register_netdev();

in numerous places.
parent 03d5d52e
...@@ -324,11 +324,8 @@ void cleanup_module(void) { ...@@ -324,11 +324,8 @@ void cleanup_module(void) {
/* Unregister devices */ /* Unregister devices */
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
if (info->dev[i].name) { if (info->dev[i].name)
rtnl_lock(); unregister_netdev(&info->dev[i]);
unregister_netdevice(&info->dev[i]);
rtnl_unlock();
}
} }
/* Reset board */ /* Reset board */
......
...@@ -390,11 +390,8 @@ static int __exit ali_ircc_close(struct ali_ircc_cb *self) ...@@ -390,11 +390,8 @@ static int __exit ali_ircc_close(struct ali_ircc_cb *self)
iobase = self->io.fir_base; iobase = self->io.fir_base;
/* Remove netdevice */ /* Remove netdevice */
if (self->netdev) { if (self->netdev)
rtnl_lock(); unregister_netdev(self->netdev);
unregister_netdevice(self->netdev);
rtnl_unlock();
}
/* Release the PORT that this driver is using */ /* Release the PORT that this driver is using */
IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", __FUNCTION__, self->io.fir_base); IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", __FUNCTION__, self->io.fir_base);
......
...@@ -1579,12 +1579,7 @@ toshoboe_close (struct pci_dev *pci_dev) ...@@ -1579,12 +1579,7 @@ toshoboe_close (struct pci_dev *pci_dev)
} }
if (self->netdev) if (self->netdev)
{ unregister_netdev(self->netdev);
/* Remove netdevice */
rtnl_lock ();
unregister_netdevice (self->netdev);
rtnl_unlock ();
}
kfree (self->ringbuf); kfree (self->ringbuf);
self->ringbuf = NULL; self->ringbuf = NULL;
......
...@@ -1231,12 +1231,10 @@ static inline int irda_usb_close(struct irda_usb_cb *self) ...@@ -1231,12 +1231,10 @@ static inline int irda_usb_close(struct irda_usb_cb *self)
ASSERT(self != NULL, return -1;); ASSERT(self != NULL, return -1;);
/* Remove netdevice */ /* Remove netdevice */
if (self->netdev) { if (self->netdev)
rtnl_lock(); unregister_netdev(self->netdev);
unregister_netdevice(self->netdev);
self->netdev = NULL; self->netdev = NULL;
rtnl_unlock();
}
/* Remove the speed buffer */ /* Remove the speed buffer */
if (self->speed_buff != NULL) { if (self->speed_buff != NULL) {
kfree(self->speed_buff); kfree(self->speed_buff);
......
...@@ -267,11 +267,8 @@ int irport_close(struct irport_cb *self) ...@@ -267,11 +267,8 @@ int irport_close(struct irport_cb *self)
self->dongle = NULL; self->dongle = NULL;
/* Remove netdevice */ /* Remove netdevice */
if (self->netdev) { if (self->netdev)
rtnl_lock(); unregister_netdev(self->netdev);
unregister_netdevice(self->netdev);
rtnl_unlock();
}
/* Release the IO-port that this driver is using */ /* Release the IO-port that this driver is using */
IRDA_DEBUG(0 , "%s(), Releasing Region %03x\n", IRDA_DEBUG(0 , "%s(), Releasing Region %03x\n",
......
...@@ -282,11 +282,8 @@ static void irtty_close(struct tty_struct *tty) ...@@ -282,11 +282,8 @@ static void irtty_close(struct tty_struct *tty)
self->dongle = NULL; self->dongle = NULL;
/* Remove netdevice */ /* Remove netdevice */
if (self->netdev) { if (self->netdev)
rtnl_lock(); unregister_netdev(self->netdev);
unregister_netdevice(self->netdev);
rtnl_unlock();
}
self = hashbin_remove(irtty, (int) self, NULL); self = hashbin_remove(irtty, (int) self, NULL);
......
...@@ -391,11 +391,8 @@ static int __exit nsc_ircc_close(struct nsc_ircc_cb *self) ...@@ -391,11 +391,8 @@ static int __exit nsc_ircc_close(struct nsc_ircc_cb *self)
iobase = self->io.fir_base; iobase = self->io.fir_base;
/* Remove netdevice */ /* Remove netdevice */
if (self->netdev) { if (self->netdev)
rtnl_lock(); unregister_netdev(self->netdev);
unregister_netdevice(self->netdev);
rtnl_unlock();
}
/* Release the PORT that this driver is using */ /* Release the PORT that this driver is using */
IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", IRDA_DEBUG(4, "%s(), Releasing Region %03x\n",
......
...@@ -1122,11 +1122,8 @@ static void __exit sa1100_irda_exit(void) ...@@ -1122,11 +1122,8 @@ static void __exit sa1100_irda_exit(void)
{ {
struct net_device *dev = dev_get_drvdata(&sa1100ir_device.dev); struct net_device *dev = dev_get_drvdata(&sa1100ir_device.dev);
if (dev) { if (dev)
rtnl_lock(); unregister_netdev(dev);
unregister_netdevice(dev);
rtnl_unlock();
}
sys_device_unregister(&sa1100ir_device); sys_device_unregister(&sa1100ir_device);
driver_unregister(&sa1100ir_driver); driver_unregister(&sa1100ir_driver);
......
...@@ -679,12 +679,8 @@ toshoboe_remove (struct pci_dev *pci_dev) ...@@ -679,12 +679,8 @@ toshoboe_remove (struct pci_dev *pci_dev)
self->recv_bufs[i] = NULL; self->recv_bufs[i] = NULL;
} }
if (self->netdev) { if (self->netdev)
/* Remove netdevice */ unregister_netdev(self->netdev);
rtnl_lock();
unregister_netdevice(self->netdev);
rtnl_unlock();
}
kfree (self->taskfilebuf); kfree (self->taskfilebuf);
self->taskfilebuf = NULL; self->taskfilebuf = NULL;
......
...@@ -299,11 +299,8 @@ static int w83977af_close(struct w83977af_ir *self) ...@@ -299,11 +299,8 @@ static int w83977af_close(struct w83977af_ir *self)
#endif /* CONFIG_USE_W977_PNP */ #endif /* CONFIG_USE_W977_PNP */
/* Remove netdevice */ /* Remove netdevice */
if (self->netdev) { if (self->netdev)
rtnl_lock(); unregister_netdev(self->netdev);
unregister_netdevice(self->netdev);
rtnl_unlock();
}
/* Release the PORT that this driver is using */ /* Release the PORT that this driver is using */
IRDA_DEBUG(0 , "%s(), Releasing Region %03x\n", IRDA_DEBUG(0 , "%s(), Releasing Region %03x\n",
......
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