]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/ide/cmd640.c
ide: remove hw_regs_t typedef
[mv-sheeva.git] / drivers / ide / cmd640.c
index e4306647d00d6782e8db72d40d82827bb085044f..1683ed5c7329c0466375d4337d679bb2b18206f2 100644 (file)
@@ -467,11 +467,10 @@ static void program_drive_counts(ide_drive_t *drive, unsigned int index)
         * so we merge the timings, using the slowest value for each timing.
         */
        if (index > 1) {
-               ide_hwif_t *hwif = drive->hwif;
-               ide_drive_t *peer = &hwif->drives[!(drive->dn & 1)];
+               ide_drive_t *peer = ide_get_pair_dev(drive);
                unsigned int mate = index ^ 1;
 
-               if (peer->dev_flags & IDE_DFLAG_PRESENT) {
+               if (peer) {
                        if (setup_count < setup_counts[mate])
                                setup_count = setup_counts[mate];
                        if (active_count < active_counts[mate])
@@ -709,7 +708,7 @@ static int __init cmd640x_init(void)
        int second_port_cmd640 = 0, rc;
        const char *bus_type, *port2;
        u8 b, cfr;
-       hw_regs_t hw[2], *hws[] = { NULL, NULL, NULL, NULL };
+       struct ide_hw hw[2], *hws[2];
 
        if (cmd640_vlb && probe_for_cmd640_vlb()) {
                bus_type = "VLB";
@@ -763,11 +762,9 @@ static int __init cmd640x_init(void)
 
        ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
        hw[0].irq = 14;
-       hw[0].chipset = ide_cmd640;
 
        ide_std_init_ports(&hw[1], 0x170, 0x376);
        hw[1].irq = 15;
-       hw[1].chipset = ide_cmd640;
 
        printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x"
                         "\n", 'a' + cmd640_chip_version - 1, bus_type, cfr);
@@ -825,7 +822,8 @@ static int __init cmd640x_init(void)
        cmd640_dump_regs();
 #endif
 
-       return ide_host_add(&cmd640_port_info, hws, NULL);
+       return ide_host_add(&cmd640_port_info, hws, second_port_cmd640 ? 2 : 1,
+                           NULL);
 }
 
 module_param_named(probe_vlb, cmd640_vlb, bool, 0);