diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 11:36:36 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 11:36:36 -0400 |
commit | dc9114e27acecc5a2ce2394a284a07e4e6ae5849 (patch) | |
tree | fd04888f8201bec284e05b8a150206f891bece0e /drivers/ide | |
parent | e277f91fef8a0ff7726ad33eb79c6f0d0c6229a8 (diff) |
ide-generic: use ide_find_port() (take 3)
There should be no functional changes caused by this patch.
v2:
* Fix comment (noticed by Sergei Shtylyov).
v3:
* Fix no initalization of idx in some case. (Johann Felix Soden)
Cc: Johann Felix Soden <johfel@users.sourceforge.net>
Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-generic.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index f3ec02ed4492..19f63e393d18 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c | |||
@@ -90,11 +90,21 @@ static int __init ide_generic_init(void) | |||
90 | int i; | 90 | int i; |
91 | 91 | ||
92 | for (i = 0; i < MAX_HWIFS; i++) { | 92 | for (i = 0; i < MAX_HWIFS; i++) { |
93 | ide_hwif_t *hwif = &ide_hwifs[i]; | 93 | ide_hwif_t *hwif; |
94 | unsigned long io_addr = ide_default_io_base(i); | 94 | unsigned long io_addr = ide_default_io_base(i); |
95 | hw_regs_t hw; | 95 | hw_regs_t hw; |
96 | 96 | ||
97 | if (hwif->chipset == ide_unknown && io_addr) { | 97 | if (io_addr) { |
98 | /* | ||
99 | * Skip probing if the corresponding | ||
100 | * slot is already occupied. | ||
101 | */ | ||
102 | hwif = ide_find_port(); | ||
103 | if (hwif == NULL || hwif->index != i) { | ||
104 | idx[i] = 0xff; | ||
105 | continue; | ||
106 | } | ||
107 | |||
98 | memset(&hw, 0, sizeof(hw)); | 108 | memset(&hw, 0, sizeof(hw)); |
99 | ide_std_init_ports(&hw, io_addr, io_addr + 0x206); | 109 | ide_std_init_ports(&hw, io_addr, io_addr + 0x206); |
100 | hw.irq = ide_default_irq(io_addr); | 110 | hw.irq = ide_default_irq(io_addr); |