MAX_HWIFS is now always equal to the number of IDE major numbers.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
/*
* save_match() is used to simplify logic in init_irq() below.
*
/*
* save_match() is used to simplify logic in init_irq() below.
*
if (!m || m->irq != hwif->irq) /* don't undo a prior perfect match */
*match = new;
}
if (!m || m->irq != hwif->irq) /* don't undo a prior perfect match */
*match = new;
}
-#endif /* MAX_HWIFS > 1 */
mutex_lock(&ide_cfg_mtx);
hwif->hwgroup = NULL;
mutex_lock(&ide_cfg_mtx);
hwif->hwgroup = NULL;
/*
* Group up with any other hwifs that share our irq(s).
*/
/*
* Group up with any other hwifs that share our irq(s).
*/
-#endif /* MAX_HWIFS > 1 */
/*
* If we are still without a hwgroup, then form a new one
*/
/*
* If we are still without a hwgroup, then form a new one
*/
* ports 0x1f0/0x170 (the ide0/ide1 defaults).
*/
mutex_lock(&ide_cfg_mtx);
* ports 0x1f0/0x170 (the ide0/ide1 defaults).
*/
mutex_lock(&ide_cfg_mtx);
- if (MAX_HWIFS == 1) {
- if (ide_indexes == 0 && i == 0)
- idx = 1;
+ if (bootable) {
+ if ((ide_indexes | i) != (1 << MAX_HWIFS) - 1)
+ idx = ffz(ide_indexes | i);
- if (bootable) {
- if ((ide_indexes | i) != (1 << MAX_HWIFS) - 1)
- idx = ffz(ide_indexes | i);
- } else {
- if ((ide_indexes | 3) != (1 << MAX_HWIFS) - 1)
- idx = ffz(ide_indexes | 3);
- else if ((ide_indexes & 3) != 3)
- idx = ffz(ide_indexes);
- }
+ if ((ide_indexes | 3) != (1 << MAX_HWIFS) - 1)
+ idx = ffz(ide_indexes | 3);
+ else if ((ide_indexes & 3) != 3)
+ idx = ffz(ide_indexes);
}
if (idx >= 0)
ide_indexes |= (1 << idx);
}
if (idx >= 0)
ide_indexes |= (1 << idx);