Skip to content

Commit dc9114e

Browse files
committed
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>
1 parent e277f91 commit dc9114e

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎drivers/ide/ide-generic.c‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,21 @@ static int __init ide_generic_init(void)
9090
int i;
9191

9292
for (i = 0; i < MAX_HWIFS; i++) {
93-
ide_hwif_t *hwif = &ide_hwifs[i];
93+
ide_hwif_t *hwif;
9494
unsigned long io_addr = ide_default_io_base(i);
9595
hw_regs_t hw;
9696

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+
98108
memset(&hw, 0, sizeof(hw));
99109
ide_std_init_ports(&hw, io_addr, io_addr + 0x206);
100110
hw.irq = ide_default_irq(io_addr);

0 commit comments

Comments
 (0)