ide: register ports with non-present devices (for warm-plug)

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent d703b79e
...@@ -1537,17 +1537,14 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) ...@@ -1537,17 +1537,14 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
continue; continue;
} }
if (ide_probe_port(hwif) < 0) { if (ide_probe_port(hwif) == 0)
ide_hwif_release_regions(hwif);
continue;
}
hwif->present = 1; hwif->present = 1;
if (hwif->chipset != ide_4drives || !hwif->mate || if (hwif->chipset != ide_4drives || !hwif->mate ||
!hwif->mate->present) !hwif->mate->present)
ide_register_port(hwif); ide_register_port(hwif);
if (hwif->present)
ide_port_tune_devices(hwif); ide_port_tune_devices(hwif);
} }
...@@ -1557,9 +1554,6 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) ...@@ -1557,9 +1554,6 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
hwif = &ide_hwifs[idx[i]]; hwif = &ide_hwifs[idx[i]];
if (!hwif->present)
continue;
if (hwif_init(hwif) == 0) { if (hwif_init(hwif) == 0) {
printk(KERN_INFO "%s: failed to initialize IDE " printk(KERN_INFO "%s: failed to initialize IDE "
"interface\n", hwif->name); "interface\n", hwif->name);
...@@ -1568,9 +1562,12 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) ...@@ -1568,9 +1562,12 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
continue; continue;
} }
if (hwif->present)
ide_port_setup_devices(hwif); ide_port_setup_devices(hwif);
ide_acpi_init(hwif); ide_acpi_init(hwif);
if (hwif->present)
ide_acpi_port_init_devices(hwif); ide_acpi_port_init_devices(hwif);
} }
...@@ -1580,12 +1577,12 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) ...@@ -1580,12 +1577,12 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
hwif = &ide_hwifs[idx[i]]; hwif = &ide_hwifs[idx[i]];
if (hwif->present) {
if (hwif->chipset == ide_unknown) if (hwif->chipset == ide_unknown)
hwif->chipset = ide_generic; hwif->chipset = ide_generic;
if (hwif->present)
hwif_register_devices(hwif); hwif_register_devices(hwif);
} }
}
for (i = 0; i < MAX_HWIFS; i++) { for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] == 0xff) if (idx[i] == 0xff)
...@@ -1593,12 +1590,12 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) ...@@ -1593,12 +1590,12 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
hwif = &ide_hwifs[idx[i]]; hwif = &ide_hwifs[idx[i]];
if (hwif->present) {
ide_sysfs_register_port(hwif); ide_sysfs_register_port(hwif);
ide_proc_register_port(hwif); ide_proc_register_port(hwif);
if (hwif->present)
ide_proc_port_register_devices(hwif); ide_proc_port_register_devices(hwif);
} }
}
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment