ide: skip probe if there are no devices on the port (v2)

In ide_probe_port() skip probe if ide_port_wait_ready() returns -ENODEV
and print error message instead of debug one if it returns -EBUSY.

v2:
Fix the default 'rc' value.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 75c2d7d7
...@@ -702,8 +702,14 @@ static int ide_probe_port(ide_hwif_t *hwif) ...@@ -702,8 +702,14 @@ static int ide_probe_port(ide_hwif_t *hwif)
if (irqd) if (irqd)
disable_irq(hwif->irq); disable_irq(hwif->irq);
if (ide_port_wait_ready(hwif) == -EBUSY) rc = ide_port_wait_ready(hwif);
printk(KERN_DEBUG "%s: Wait for ready failed before probe !\n", hwif->name); if (rc == -ENODEV) {
printk(KERN_INFO "%s: no devices on the port\n", hwif->name);
goto out;
} else if (rc == -EBUSY)
printk(KERN_ERR "%s: not ready before the probe\n", hwif->name);
else
rc = -ENODEV;
/* /*
* Second drive should only exist if first drive was found, * Second drive should only exist if first drive was found,
...@@ -714,7 +720,7 @@ static int ide_probe_port(ide_hwif_t *hwif) ...@@ -714,7 +720,7 @@ static int ide_probe_port(ide_hwif_t *hwif)
if (drive->dev_flags & IDE_DFLAG_PRESENT) if (drive->dev_flags & IDE_DFLAG_PRESENT)
rc = 0; rc = 0;
} }
out:
/* /*
* Use cached IRQ number. It might be (and is...) changed by probe * Use cached IRQ number. It might be (and is...) changed by probe
* code above * code above
......
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