mirror of
https://github.com/adulau/aha.git
synced 2024-12-30 12:46:17 +00:00
ide: skip not present devices in init_gendisk()
No need to initialize drive->gendev and waste memory on IDE settings for not present devices. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
521fd1e8d1
commit
5c2854e62c
1 changed files with 4 additions and 0 deletions
|
@ -1188,6 +1188,10 @@ static void init_gendisk (ide_hwif_t *hwif)
|
|||
|
||||
for (unit = 0; unit < MAX_DRIVES; ++unit) {
|
||||
ide_drive_t * drive = &hwif->drives[unit];
|
||||
|
||||
if (!drive->present)
|
||||
continue;
|
||||
|
||||
ide_add_generic_settings(drive);
|
||||
snprintf(drive->gendev.bus_id,BUS_ID_SIZE,"%u.%u",
|
||||
hwif->index,unit);
|
||||
|
|
Loading…
Reference in a new issue