ide: move hwif->present check out from ide_proc_register_port()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 2 Feb 2008 18:56:43 +0000 (19:56 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 2 Feb 2008 18:56:43 +0000 (19:56 +0100)
Move hwif->present check out from ide_proc_register_port() to
ide_device_add_all().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-probe.c
drivers/ide/ide-proc.c

index abb695aa021d81e79206876c0a3dc1b7b9850e08..1ef293757043755055545b405765303cd20d4449 100644 (file)
@@ -1448,8 +1448,13 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
        }
 
        for (i = 0; i < MAX_HWIFS; i++) {
-               if (idx[i] != 0xff)
-                       ide_proc_register_port(&ide_hwifs[idx[i]]);
+               if (idx[i] == 0xff)
+                       continue;
+
+               hwif = &ide_hwifs[idx[i]];
+
+               if (hwif->present)
+                       ide_proc_register_port(hwif);
        }
 
        return rc;
index 00c249cba236c88e90d75411e64ce5841f1f2f6e..c6ed84b84e8b552689b3ede7260ce4f1b4209ee8 100644 (file)
@@ -793,9 +793,6 @@ static ide_proc_entry_t hwif_entries[] = {
 
 void ide_proc_register_port(ide_hwif_t *hwif)
 {
-       if (!hwif->present)
-               return;
-
        if (!hwif->proc) {
                hwif->proc = proc_mkdir(hwif->name, proc_ide_root);