ide: skip probe if there are no devices on the port
PATCH 1/1 ide: skip probe if there are no devices on the port
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.
Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>
---
against Linus' tree
drivers/ide/ide-probe.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/ide/ide-probe.c +7 -3
@@ -702,8 +702,12 @@ static int ide_probe_port(ide_hwif_t *hwif (irqd)disable_irq (hwif->irq); -if (ide_port_wait_ready (hwif) == -EBUSY ) -printk (KERN_DEBUG "%s: Wait for ready failed before probe !\n" , hwif->name); + rc =ide_port_wait_ready (hwif); +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);/* * Second drive should only exist if first drive was found,
@@ -714,7 +718,7 @@ static int ide_probe_port(ide_hwif_t *hwif (drive->dev_flags &IDE_DFLAG_PRESENT ) rc =0 ; } - +out:/* * Use cached IRQ number. It might be (and is...) changed by probe * code above