diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index be469dbbe8fb2760652e383e8889300c3f5b7682..709b9e4d2871239f75c8f6b8f59834f8375f003f 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c @@ -20,8 +20,14 @@ static int __init ide_generic_init(void) if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) ide_get_lock(NULL, NULL); /* for atari only */ - for (i = 0; i < MAX_HWIFS; i++) - idx[i] = ide_hwifs[i].present ? 0xff : i; + for (i = 0; i < MAX_HWIFS; i++) { + ide_hwif_t *hwif = &ide_hwifs[i]; + + if (hwif->io_ports[IDE_DATA_OFFSET] && !hwif->present) + idx[i] = i; + else + idx[i] = 0xff; + } ide_device_add_all(idx, NULL);