diff options
-rw-r--r-- | drivers/ide/setup-pci.c | 18 |
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 | } | ||
545 | out: | 547 | out: |
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); |