Skip to content

Commit

Permalink
ide: skip probe if there are no devices on the port (v2)
Browse files Browse the repository at this point in the history
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: Bartlomiej Zolnierkiewicz <[email protected]>
  • Loading branch information
bzolnier committed Jun 8, 2009
1 parent 75c2d7d commit a20b2a4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,14 @@ static int ide_probe_port(ide_hwif_t *hwif)
if (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);
else
rc = -ENODEV;

/*
* Second drive should only exist if first drive was found,
Expand All @@ -714,7 +720,7 @@ static int ide_probe_port(ide_hwif_t *hwif)
if (drive->dev_flags & IDE_DFLAG_PRESENT)
rc = 0;
}

out:
/*
* Use cached IRQ number. It might be (and is...) changed by probe
* code above
Expand Down

0 comments on commit a20b2a4

Please sign in to comment.