diff options
Diffstat (limited to 'drivers/virtio/virtio_pci.c')
| -rw-r--r-- | drivers/virtio/virtio_pci.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 4fb5b2bf2348..4bcc8b82640b 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c | |||
| @@ -590,15 +590,10 @@ static struct virtio_config_ops virtio_pci_config_ops = { | |||
| 590 | 590 | ||
| 591 | static void virtio_pci_release_dev(struct device *_d) | 591 | static void virtio_pci_release_dev(struct device *_d) |
| 592 | { | 592 | { |
| 593 | struct virtio_device *dev = container_of(_d, struct virtio_device, dev); | 593 | struct virtio_device *dev = container_of(_d, struct virtio_device, |
| 594 | dev); | ||
| 594 | struct virtio_pci_device *vp_dev = to_vp_device(dev); | 595 | struct virtio_pci_device *vp_dev = to_vp_device(dev); |
| 595 | struct pci_dev *pci_dev = vp_dev->pci_dev; | ||
| 596 | 596 | ||
| 597 | vp_del_vqs(dev); | ||
| 598 | pci_set_drvdata(pci_dev, NULL); | ||
| 599 | pci_iounmap(pci_dev, vp_dev->ioaddr); | ||
| 600 | pci_release_regions(pci_dev); | ||
| 601 | pci_disable_device(pci_dev); | ||
| 602 | kfree(vp_dev); | 597 | kfree(vp_dev); |
| 603 | } | 598 | } |
| 604 | 599 | ||
| @@ -681,6 +676,12 @@ static void __devexit virtio_pci_remove(struct pci_dev *pci_dev) | |||
| 681 | struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); | 676 | struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); |
| 682 | 677 | ||
| 683 | unregister_virtio_device(&vp_dev->vdev); | 678 | unregister_virtio_device(&vp_dev->vdev); |
| 679 | |||
| 680 | vp_del_vqs(&vp_dev->vdev); | ||
| 681 | pci_set_drvdata(pci_dev, NULL); | ||
| 682 | pci_iounmap(pci_dev, vp_dev->ioaddr); | ||
| 683 | pci_release_regions(pci_dev); | ||
| 684 | pci_disable_device(pci_dev); | ||
| 684 | } | 685 | } |
| 685 | 686 | ||
| 686 | #ifdef CONFIG_PM | 687 | #ifdef CONFIG_PM |
