]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/mips/swarm.c
Merge branch 'for-2.6.27' of git://linux-nfs.org/~bfields/linux
[linux-2.6-omap-h63xx.git] / drivers / ide / mips / swarm.c
index 9f1212cc4aed3e33152a1ff0c32eebf62ee0f987..badf79fc9e3a1c67c3eef99bbbce4cb9c31eb355 100644 (file)
@@ -72,12 +72,11 @@ static const struct ide_port_info swarm_port_info = {
  */
 static int __devinit swarm_ide_probe(struct device *dev)
 {
-       ide_hwif_t *hwif;
        u8 __iomem *base;
+       struct ide_host *host;
        phys_t offset, size;
-       hw_regs_t hw;
-       int i;
-       u8 idx[] = { 0xff, 0xff, 0xff, 0xff };
+       int i, rc;
+       hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
 
        if (!SIBYTE_HAVE_IDE)
                return -ENODEV;
@@ -116,26 +115,17 @@ static int __devinit swarm_ide_probe(struct device *dev)
        hw.irq = K_INT_GB_IDE;
        hw.chipset = ide_generic;
 
-       hwif = ide_find_port_slot(&swarm_port_info);
-       if (hwif == NULL)
+       rc = ide_host_add(&swarm_port_info, hws, &host);
+       if (rc)
                goto err;
 
-       ide_init_port_hw(hwif, &hw);
-
-       /* Setup MMIO ops. */
-       default_hwif_mmiops(hwif);
-
-       idx[0] = hwif->index;
-
-       ide_device_add(idx, &swarm_port_info);
-
-       dev_set_drvdata(dev, hwif);
+       dev_set_drvdata(dev, host);
 
        return 0;
 err:
        release_resource(&swarm_ide_resource);
        iounmap(base);
-       return -ENOMEM;
+       return rc;
 }
 
 static struct device_driver swarm_ide_driver = {