]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/legacy/ide-4drives.c
Merge branches 'x86/xen', 'x86/build', 'x86/microcode', 'x86/mm-debug-v2', 'x86/memor...
[linux-2.6-omap-h63xx.git] / drivers / ide / legacy / ide-4drives.c
index 89c8ff0a4d085f81e89bffba2fc3ba12a89f97c2..c76d55de6996413496ddc9c8d725f3feb633c860 100644 (file)
@@ -28,10 +28,8 @@ static const struct ide_port_info ide_4drives_port_info = {
 
 static int __init ide_4drives_init(void)
 {
-       ide_hwif_t *hwif, *mate;
        unsigned long base = 0x1f0, ctl = 0x3f6;
-       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
-       hw_regs_t hw;
+       hw_regs_t hw, *hws[] = { &hw, &hw, NULL, NULL };
 
        if (probe_4drives == 0)
                return -ENODEV;
@@ -55,21 +53,7 @@ static int __init ide_4drives_init(void)
        hw.irq = 14;
        hw.chipset = ide_4drives;
 
-       hwif = ide_find_port();
-       if (hwif) {
-               ide_init_port_hw(hwif, &hw);
-               idx[0] = hwif->index;
-       }
-
-       mate = ide_find_port();
-       if (mate) {
-               ide_init_port_hw(mate, &hw);
-               idx[1] = mate->index;
-       }
-
-       ide_device_add(idx, &ide_4drives_port_info);
-
-       return 0;
+       return ide_host_add(&ide_4drives_port_info, hws, NULL);
 }
 
 module_init(ide_4drives_init);