]> err.no Git - linux-2.6/blobdiff - drivers/ide/pci/scc_pata.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg...
[linux-2.6] / drivers / ide / pci / scc_pata.c
index 5b1a0e950dfd9c788e6dcaaaee90664aad8e66c3..6cde48bba6f8825c998218de12d88fb9ca4ec773 100644 (file)
@@ -65,7 +65,7 @@
 
 static struct scc_ports {
        unsigned long ctl, dma;
-       ide_hwif_t *hwif;  /* for removing port from system */
+       struct ide_host *host;  /* for removing port from system */
 } scc_ports[MAX_HWIFS];
 
 /* PIO transfer mode  table */
@@ -586,14 +586,9 @@ static int scc_ide_setup_pci_device(struct pci_dev *dev,
                                    const struct ide_port_info *d)
 {
        struct scc_ports *ports = pci_get_drvdata(dev);
-       ide_hwif_t *hwif = NULL;
+       struct ide_host *host;
        hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
-       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
-       int i;
-
-       hwif = ide_find_port_slot(d);
-       if (hwif == NULL)
-               return -ENOMEM;
+       int i, rc;
 
        memset(&hw, 0, sizeof(hw));
        for (i = 0; i <= 8; i++)
@@ -602,9 +597,11 @@ static int scc_ide_setup_pci_device(struct pci_dev *dev,
        hw.dev = &dev->dev;
        hw.chipset = ide_pci;
 
-       idx[0] = hwif->index;
+       rc = ide_host_add(d, hws, &host);
+       if (rc)
+               return rc;
 
-       ide_device_add(idx, d, hws);
+       ports->host = host;
 
        return 0;
 }
@@ -830,7 +827,7 @@ static void __devinit init_iops_scc(ide_hwif_t *hwif)
        init_mmio_iops_scc(hwif);
 }
 
-static u8 __devinit scc_cable_detect(ide_hwif_t *hwif)
+static u8 scc_cable_detect(ide_hwif_t *hwif)
 {
        return ATA_CBL_PATA80;
 }
@@ -848,8 +845,6 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif)
 {
        struct scc_ports *ports = ide_get_hwifdata(hwif);
 
-       ports->hwif = hwif;
-
        /* PTERADD */
        out_be32((void __iomem *)(hwif->dma_base + 0x018), hwif->dmatable_dma);
 
@@ -932,7 +927,8 @@ static int __devinit scc_init_one(struct pci_dev *dev, const struct pci_device_i
 static void __devexit scc_remove(struct pci_dev *dev)
 {
        struct scc_ports *ports = pci_get_drvdata(dev);
-       ide_hwif_t *hwif = ports->hwif;
+       struct ide_host *host = ports->host;
+       ide_hwif_t *hwif = host->ports[0];
 
        if (hwif->dmatable_cpu) {
                pci_free_consistent(dev, PRD_ENTRIES * PRD_BYTES,
@@ -940,7 +936,7 @@ static void __devexit scc_remove(struct pci_dev *dev)
                hwif->dmatable_cpu = NULL;
        }
 
-       ide_unregister(hwif);
+       ide_host_remove(host);
 
        iounmap((void*)ports->dma);
        iounmap((void*)ports->ctl);