diff options
Diffstat (limited to 'drivers/ide/setup-pci.c')
-rw-r--r-- | drivers/ide/setup-pci.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 65fc08b6b6d0..7ae6ae45331f 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -480,7 +480,7 @@ EXPORT_SYMBOL_GPL(ide_pci_setup_ports); | |||
480 | */ | 480 | */ |
481 | static int do_ide_setup_pci_device(struct pci_dev *dev, | 481 | static int do_ide_setup_pci_device(struct pci_dev *dev, |
482 | const struct ide_port_info *d, | 482 | const struct ide_port_info *d, |
483 | u8 *idx, u8 noisy) | 483 | u8 noisy) |
484 | { | 484 | { |
485 | int tried_config = 0; | 485 | int tried_config = 0; |
486 | int pciirq, ret; | 486 | int pciirq, ret; |
@@ -529,9 +529,7 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, | |||
529 | d->name, pciirq); | 529 | d->name, pciirq); |
530 | } | 530 | } |
531 | 531 | ||
532 | /* FIXME: silent failure can happen */ | 532 | ret = pciirq; |
533 | |||
534 | ide_pci_setup_ports(dev, d, pciirq, idx); | ||
535 | out: | 533 | out: |
536 | return ret; | 534 | return ret; |
537 | } | 535 | } |
@@ -541,10 +539,14 @@ int ide_setup_pci_device(struct pci_dev *dev, const struct ide_port_info *d) | |||
541 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 539 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
542 | int ret; | 540 | int ret; |
543 | 541 | ||
544 | ret = do_ide_setup_pci_device(dev, d, &idx[0], 1); | 542 | ret = do_ide_setup_pci_device(dev, d, 1); |
543 | |||
544 | if (ret >= 0) { | ||
545 | /* FIXME: silent failure can happen */ | ||
546 | ide_pci_setup_ports(dev, d, ret, &idx[0]); | ||
545 | 547 | ||
546 | if (ret >= 0) | ||
547 | ide_device_add(idx, d); | 548 | ide_device_add(idx, d); |
549 | } | ||
548 | 550 | ||
549 | return ret; | 551 | return ret; |
550 | } | 552 | } |
@@ -558,13 +560,17 @@ int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2, | |||
558 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 560 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
559 | 561 | ||
560 | for (i = 0; i < 2; i++) { | 562 | for (i = 0; i < 2; i++) { |
561 | ret = do_ide_setup_pci_device(pdev[i], d, &idx[i*2], !i); | 563 | ret = do_ide_setup_pci_device(pdev[i], d, !i); |
564 | |||
562 | /* | 565 | /* |
563 | * FIXME: Mom, mom, they stole me the helper function to undo | 566 | * FIXME: Mom, mom, they stole me the helper function to undo |
564 | * do_ide_setup_pci_device() on the first device! | 567 | * do_ide_setup_pci_device() on the first device! |
565 | */ | 568 | */ |
566 | if (ret < 0) | 569 | if (ret < 0) |
567 | goto out; | 570 | goto out; |
571 | |||
572 | /* FIXME: silent failure can happen */ | ||
573 | ide_pci_setup_ports(pdev[i], d, ret, &idx[i*2]); | ||
568 | } | 574 | } |
569 | 575 | ||
570 | ide_device_add(idx, d); | 576 | ide_device_add(idx, d); |