IDE: Unregister and disable devices if initialization fails.
authorIan Campbell <Ian.Campbell@citrix.com>
Mon, 2 Feb 2009 19:12:22 +0000 (20:12 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Mon, 2 Feb 2009 19:12:22 +0000 (20:12 +0100)
On reboot the loop in device_shutdown gets confused by these partially
initialized devices and goes into an infinite loop. Therefore unregister
and disable these devices.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
[bart: remove leftover hwif->present clearing + update patch description]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-probe.c

index 6bab2ac1f5b952f8197406a334081ea4a29b0854..ce0818a993f68a42bf445bc79dea4eaa0ccc94da 100644 (file)
@@ -1549,7 +1549,8 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
                if (hwif_init(hwif) == 0) {
                        printk(KERN_INFO "%s: failed to initialize IDE "
                                         "interface\n", hwif->name);
-                       hwif->present = 0;
+                       device_unregister(&hwif->gendev);
+                       ide_disable_port(hwif);
                        continue;
                }