aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/setup-pci.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-24 16:53:12 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-24 16:53:12 -0400
commit8c2eece50a368c7986bae0b3e52739558dd71b51 (patch)
tree967c174b75819ed960950e0ed19057f7b4118f1d /drivers/ide/setup-pci.c
parenta742d6cf0b37b1a96a1549b1fda0d6b19e0185c2 (diff)
ide: call ide_pci_setup_ports() before do_ide_setup_pci_device()
* Call ide_pci_setup_ports() before do_ide_setup_pci_device() in ide_setup_pci_device[s](). While at it: * Remove stale FIXMEs. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/setup-pci.c')
-rw-r--r--drivers/ide/setup-pci.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 98c663d62b9f..b85de71fdc88 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -534,14 +534,16 @@ int ide_setup_pci_device(struct pci_dev *dev, const struct ide_port_info *d)
534 if (ret < 0) 534 if (ret < 0)
535 goto out; 535 goto out;
536 536
537 ide_pci_setup_ports(dev, d, 0, &hw[0], &hws[0]);
538
537 ret = do_ide_setup_pci_device(dev, d, 1); 539 ret = do_ide_setup_pci_device(dev, d, 1);
540 if (ret < 0)
541 goto out;
538 542
539 if (ret >= 0) { 543 /* fixup IRQ */
540 /* FIXME: silent failure can happen */ 544 hw[1].irq = hw[0].irq = ret;
541 ide_pci_setup_ports(dev, d, ret, &hw[0], &hws[0]);
542 545
543 ret = ide_host_add(d, hws, NULL); 546 ret = ide_host_add(d, hws, NULL);
544 }
545out: 547out:
546 return ret; 548 return ret;
547} 549}
@@ -559,6 +561,8 @@ int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2,
559 if (ret < 0) 561 if (ret < 0)
560 goto out; 562 goto out;
561 563
564 ide_pci_setup_ports(pdev[i], d, 0, &hw[i*2], &hws[i*2]);
565
562 ret = do_ide_setup_pci_device(pdev[i], d, !i); 566 ret = do_ide_setup_pci_device(pdev[i], d, !i);
563 567
564 /* 568 /*
@@ -568,8 +572,8 @@ int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2,
568 if (ret < 0) 572 if (ret < 0)
569 goto out; 573 goto out;
570 574
571 /* FIXME: silent failure can happen */ 575 /* fixup IRQ */
572 ide_pci_setup_ports(pdev[i], d, ret, &hw[i*2], &hws[i*2]); 576 hw[i*2 + 1].irq = hw[i*2].irq = ret;
573 } 577 }
574 578
575 ret = ide_host_add(d, hws, NULL); 579 ret = ide_host_add(d, hws, NULL);