aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio/virtio_pci.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2008-03-19 21:35:04 -0400
committerRusty Russell <rusty@rustcorp.com.au>2008-03-27 20:05:51 -0400
commitbd6c26900bae19bd51abedfc9a8a281afbba3a06 (patch)
treecb2058d113d81fa4b168b8675f000f8aecbf8b26 /drivers/virtio/virtio_pci.c
parent3085354de635179d70c240e6d942bcbd1d93056c (diff)
virtio_pci: unregister virtio device at device remove
Make sure to call unregister_virtio_device() when a virtio device is removed. Otherwise, virtio_pci.ko cannot be rmmod'd. This was spotted by Marcelo Tosatti. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/virtio/virtio_pci.c')
-rw-r--r--drivers/virtio/virtio_pci.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index 59a8f73dec73..6c8ecde6aad1 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -388,6 +388,7 @@ static void __devexit virtio_pci_remove(struct pci_dev *pci_dev)
388{ 388{
389 struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); 389 struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
390 390
391 unregister_virtio_device(&vp_dev->vdev);
391 free_irq(pci_dev->irq, vp_dev); 392 free_irq(pci_dev->irq, vp_dev);
392 pci_set_drvdata(pci_dev, NULL); 393 pci_set_drvdata(pci_dev, NULL);
393 pci_iounmap(pci_dev, vp_dev->ioaddr); 394 pci_iounmap(pci_dev, vp_dev->ioaddr);