diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-24 16:53:21 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-24 16:53:21 -0400 |
commit | a6c43a2be9721d00ef9d6ef5b7b0e8113444577b (patch) | |
tree | ec4c949605d2afd508c9e4c123abafa63701aece /drivers/ide/pci | |
parent | 741ac62f6fca55ddbef52513fbc687ba6b04f99e (diff) |
hpt366: add ->remove method and module_exit()
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci')
-rw-r--r-- | drivers/ide/pci/hpt366.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 8f29571345a2..398808905f94 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -1627,6 +1627,17 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic | |||
1627 | return ret; | 1627 | return ret; |
1628 | } | 1628 | } |
1629 | 1629 | ||
1630 | static void __devexit hpt366_remove(struct pci_dev *dev) | ||
1631 | { | ||
1632 | struct ide_host *host = pci_get_drvdata(dev); | ||
1633 | struct ide_info *info = host->host_priv; | ||
1634 | struct pci_dev *dev2 = host->dev[1] ? to_pci_dev(host->dev[1]) : NULL; | ||
1635 | |||
1636 | ide_pci_remove(dev); | ||
1637 | pci_dev_put(dev2); | ||
1638 | kfree(info); | ||
1639 | } | ||
1640 | |||
1630 | static const struct pci_device_id hpt366_pci_tbl[] __devinitconst = { | 1641 | static const struct pci_device_id hpt366_pci_tbl[] __devinitconst = { |
1631 | { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), 0 }, | 1642 | { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), 0 }, |
1632 | { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), 1 }, | 1643 | { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), 1 }, |
@@ -1642,6 +1653,7 @@ static struct pci_driver driver = { | |||
1642 | .name = "HPT366_IDE", | 1653 | .name = "HPT366_IDE", |
1643 | .id_table = hpt366_pci_tbl, | 1654 | .id_table = hpt366_pci_tbl, |
1644 | .probe = hpt366_init_one, | 1655 | .probe = hpt366_init_one, |
1656 | .remove = hpt366_remove, | ||
1645 | }; | 1657 | }; |
1646 | 1658 | ||
1647 | static int __init hpt366_ide_init(void) | 1659 | static int __init hpt366_ide_init(void) |
@@ -1649,7 +1661,13 @@ static int __init hpt366_ide_init(void) | |||
1649 | return ide_pci_register_driver(&driver); | 1661 | return ide_pci_register_driver(&driver); |
1650 | } | 1662 | } |
1651 | 1663 | ||
1664 | static void __exit hpt366_ide_exit(void) | ||
1665 | { | ||
1666 | pci_unregister_driver(&driver); | ||
1667 | } | ||
1668 | |||
1652 | module_init(hpt366_ide_init); | 1669 | module_init(hpt366_ide_init); |
1670 | module_exit(hpt366_ide_exit); | ||
1653 | 1671 | ||
1654 | MODULE_AUTHOR("Andre Hedrick"); | 1672 | MODULE_AUTHOR("Andre Hedrick"); |
1655 | MODULE_DESCRIPTION("PCI driver module for Highpoint HPT366 IDE"); | 1673 | MODULE_DESCRIPTION("PCI driver module for Highpoint HPT366 IDE"); |