diff options
Diffstat (limited to 'drivers/ide/setup-pci.c')
-rw-r--r-- | drivers/ide/setup-pci.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 118fb3205ca8..67035ba4bf5e 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -702,6 +702,7 @@ out: | |||
702 | 702 | ||
703 | int ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d) | 703 | int ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d) |
704 | { | 704 | { |
705 | ide_hwif_t *hwif = NULL, *mate = NULL; | ||
705 | ata_index_t index_list; | 706 | ata_index_t index_list; |
706 | int ret; | 707 | int ret; |
707 | 708 | ||
@@ -710,11 +711,19 @@ int ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d) | |||
710 | goto out; | 711 | goto out; |
711 | 712 | ||
712 | if ((index_list.b.low & 0xf0) != 0xf0) | 713 | if ((index_list.b.low & 0xf0) != 0xf0) |
713 | probe_hwif_init_with_fixup(&ide_hwifs[index_list.b.low], d->fixup); | 714 | hwif = &ide_hwifs[index_list.b.low]; |
714 | if ((index_list.b.high & 0xf0) != 0xf0) | 715 | if ((index_list.b.high & 0xf0) != 0xf0) |
715 | probe_hwif_init_with_fixup(&ide_hwifs[index_list.b.high], d->fixup); | 716 | mate = &ide_hwifs[index_list.b.high]; |
716 | 717 | ||
717 | create_proc_ide_interfaces(); | 718 | if (hwif) |
719 | probe_hwif_init_with_fixup(hwif, d->fixup); | ||
720 | if (mate) | ||
721 | probe_hwif_init_with_fixup(mate, d->fixup); | ||
722 | |||
723 | if (hwif) | ||
724 | ide_proc_register_port(hwif); | ||
725 | if (mate) | ||
726 | ide_proc_register_port(mate); | ||
718 | out: | 727 | out: |
719 | return ret; | 728 | return ret; |
720 | } | 729 | } |
@@ -748,13 +757,22 @@ int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2, | |||
748 | } | 757 | } |
749 | } | 758 | } |
750 | 759 | ||
751 | create_proc_ide_interfaces(); | 760 | for (i = 0; i < 2; i++) { |
761 | u8 idx[2] = { index_list[i].b.low, index_list[i].b.high }; | ||
762 | int j; | ||
763 | |||
764 | for (j = 0; j < 2; j++) { | ||
765 | if ((idx[j] & 0xf0) != 0xf0) | ||
766 | ide_proc_register_port(ide_hwifs + idx[j]); | ||
767 | } | ||
768 | } | ||
752 | out: | 769 | out: |
753 | return ret; | 770 | return ret; |
754 | } | 771 | } |
755 | 772 | ||
756 | EXPORT_SYMBOL_GPL(ide_setup_pci_devices); | 773 | EXPORT_SYMBOL_GPL(ide_setup_pci_devices); |
757 | 774 | ||
775 | #ifdef CONFIG_IDEPCI_PCIBUS_ORDER | ||
758 | /* | 776 | /* |
759 | * Module interfaces | 777 | * Module interfaces |
760 | */ | 778 | */ |
@@ -861,3 +879,4 @@ void __init ide_scan_pcibus (int scan_direction) | |||
861 | __pci_register_driver(d, d->driver.owner, d->driver.mod_name); | 879 | __pci_register_driver(d, d->driver.owner, d->driver.mod_name); |
862 | } | 880 | } |
863 | } | 881 | } |
882 | #endif | ||