[PATCH 10/22] ide: skip not present devices in init_gendisk()

From: Bartlomiej Zolnierkiewicz
Date: Wed Jan 16 2008 - 18:17:42 EST


No need to initialize drive->gendev and waste memory on IDE settings
for not present devices.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
---
drivers/ide/ide-probe.c | 4 ++++
1 file changed, 4 insertions(+)

Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1194,6 +1194,10 @@ static void init_gendisk (ide_hwif_t *hw

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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/