- if ((index_list.b.low & 0xf0) != 0xf0)
- probe_hwif_init(&ide_hwifs[index_list.b.low]);
- if ((index_list.b.high & 0xf0) != 0xf0)
- probe_hwif_init(&ide_hwifs[index_list.b.high]);
- if ((index_list2.b.low & 0xf0) != 0xf0)
- probe_hwif_init(&ide_hwifs[index_list2.b.low]);
- if ((index_list2.b.high & 0xf0) != 0xf0)
- probe_hwif_init(&ide_hwifs[index_list2.b.high]);
+ for (i = 0; i < 2; i++) {
+ ret = do_ide_setup_pci_device(pdev[i], d, index_list + i, !i);
+ /*
+ * FIXME: Mom, mom, they stole me the helper function to undo
+ * do_ide_setup_pci_device() on the first device!
+ */
+ if (ret < 0)
+ goto out;
+ }
+
+ for (i = 0; i < 2; i++) {
+ u8 idx[2] = { index_list[i].b.low, index_list[i].b.high };
+ int j;
+
+ for (j = 0; j < 2; j++) {
+ if ((idx[j] & 0xf0) != 0xf0)
+ probe_hwif_init(ide_hwifs + idx[j]);
+ }
+ }