siimage: convert to use ->host_priv
[safe/jmp/linux-2.6] / drivers / ide / pci / delkin_cb.c
index 538f804..f84bfb4 100644 (file)
@@ -56,11 +56,10 @@ static const struct ide_port_info delkin_cb_port_info = {
 static int __devinit
 delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
 {
+       struct ide_host *host;
        unsigned long base;
-       hw_regs_t hw;
-       ide_hwif_t *hwif = NULL;
        int i, rc;
-       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+       hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
 
        rc = pci_enable_device(dev);
        if (rc) {
@@ -87,35 +86,26 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
        hw.dev = &dev->dev;
        hw.chipset = ide_pci;           /* this enables IRQ sharing */
 
-       hwif = ide_find_port();
-       if (hwif == NULL)
+       rc = ide_host_add(&delkin_cb_port_info, hws, &host);
+       if (rc)
                goto out_disable;
 
-       i = hwif->index;
-
-       ide_init_port_data(hwif, i);
-       ide_init_port_hw(hwif, &hw);
-
-       idx[0] = i;
-
-       ide_device_add(idx, &delkin_cb_port_info);
-
-       pci_set_drvdata(dev, hwif);
+       pci_set_drvdata(dev, host);
 
        return 0;
 
 out_disable:
        pci_release_regions(dev);
        pci_disable_device(dev);
-       return -ENODEV;
+       return rc;
 }
 
 static void
 delkin_cb_remove (struct pci_dev *dev)
 {
-       ide_hwif_t *hwif = pci_get_drvdata(dev);
+       struct ide_host *host = pci_get_drvdata(dev);
 
-       ide_unregister(hwif);
+       ide_host_remove(host);
 
        pci_release_regions(dev);
        pci_disable_device(dev);
@@ -135,14 +125,12 @@ static struct pci_driver driver = {
        .remove         = delkin_cb_remove,
 };
 
-static int
-delkin_cb_init (void)
+static int __init delkin_cb_init(void)
 {
        return pci_register_driver(&driver);
 }
 
-static void
-delkin_cb_exit (void)
+static void __exit delkin_cb_exit(void)
 {
        pci_unregister_driver(&driver);
 }