diff options
-rw-r--r-- | drivers/ide/pci/siimage.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index 1388ffa97644..f2e4dac9b719 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c | |||
@@ -800,6 +800,24 @@ static int __devinit siimage_init_one(struct pci_dev *dev, | |||
800 | return rc; | 800 | return rc; |
801 | } | 801 | } |
802 | 802 | ||
803 | static void __devexit siimage_remove(struct pci_dev *dev) | ||
804 | { | ||
805 | struct ide_host *host = pci_get_drvdata(dev); | ||
806 | void __iomem *ioaddr = host->host_priv; | ||
807 | |||
808 | ide_pci_remove(dev); | ||
809 | |||
810 | if (ioaddr) { | ||
811 | resource_size_t bar5 = pci_resource_start(dev, 5); | ||
812 | unsigned long barsize = pci_resource_len(dev, 5); | ||
813 | |||
814 | iounmap(ioaddr); | ||
815 | release_mem_region(bar5, barsize); | ||
816 | } | ||
817 | |||
818 | pci_disable_device(dev); | ||
819 | } | ||
820 | |||
803 | static const struct pci_device_id siimage_pci_tbl[] = { | 821 | static const struct pci_device_id siimage_pci_tbl[] = { |
804 | { PCI_VDEVICE(CMD, PCI_DEVICE_ID_SII_680), 0 }, | 822 | { PCI_VDEVICE(CMD, PCI_DEVICE_ID_SII_680), 0 }, |
805 | #ifdef CONFIG_BLK_DEV_IDE_SATA | 823 | #ifdef CONFIG_BLK_DEV_IDE_SATA |
@@ -814,6 +832,7 @@ static struct pci_driver driver = { | |||
814 | .name = "SiI_IDE", | 832 | .name = "SiI_IDE", |
815 | .id_table = siimage_pci_tbl, | 833 | .id_table = siimage_pci_tbl, |
816 | .probe = siimage_init_one, | 834 | .probe = siimage_init_one, |
835 | .remove = siimage_remove, | ||
817 | }; | 836 | }; |
818 | 837 | ||
819 | static int __init siimage_ide_init(void) | 838 | static int __init siimage_ide_init(void) |
@@ -821,7 +840,13 @@ static int __init siimage_ide_init(void) | |||
821 | return ide_pci_register_driver(&driver); | 840 | return ide_pci_register_driver(&driver); |
822 | } | 841 | } |
823 | 842 | ||
843 | static void __exit siimage_ide_exit(void) | ||
844 | { | ||
845 | pci_unregister_driver(&driver); | ||
846 | } | ||
847 | |||
824 | module_init(siimage_ide_init); | 848 | module_init(siimage_ide_init); |
849 | module_exit(siimage_ide_exit); | ||
825 | 850 | ||
826 | MODULE_AUTHOR("Andre Hedrick, Alan Cox"); | 851 | MODULE_AUTHOR("Andre Hedrick, Alan Cox"); |
827 | MODULE_DESCRIPTION("PCI driver module for SiI IDE"); | 852 | MODULE_DESCRIPTION("PCI driver module for SiI IDE"); |