aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r--drivers/ide/ide-probe.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 29649d09dbb8..3f9faef5e50e 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -233,16 +233,6 @@ static void do_identify(ide_drive_t *drive, u8 cmd)
233 drive->dev_flags |= IDE_DFLAG_PRESENT; 233 drive->dev_flags |= IDE_DFLAG_PRESENT;
234 drive->dev_flags &= ~IDE_DFLAG_DEAD; 234 drive->dev_flags &= ~IDE_DFLAG_DEAD;
235 235
236 /*
237 * Check for an ATAPI device
238 */
239 if (cmd == ATA_CMD_ID_ATAPI)
240 ide_classify_atapi_dev(drive);
241 else
242 /*
243 * Not an ATAPI device: looks like a "regular" hard disk
244 */
245 ide_classify_ata_dev(drive);
246 return; 236 return;
247err_misc: 237err_misc:
248 kfree(id); 238 kfree(id);
@@ -480,6 +470,8 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
480static u8 probe_for_drive(ide_drive_t *drive) 470static u8 probe_for_drive(ide_drive_t *drive)
481{ 471{
482 char *m; 472 char *m;
473 int rc;
474 u8 cmd;
483 475
484 /* 476 /*
485 * In order to keep things simple we have an id 477 * In order to keep things simple we have an id
@@ -504,9 +496,13 @@ static u8 probe_for_drive(ide_drive_t *drive)
504 /* skip probing? */ 496 /* skip probing? */
505 if ((drive->dev_flags & IDE_DFLAG_NOPROBE) == 0) { 497 if ((drive->dev_flags & IDE_DFLAG_NOPROBE) == 0) {
506 /* if !(success||timed-out) */ 498 /* if !(success||timed-out) */
507 if (do_probe(drive, ATA_CMD_ID_ATA) >= 2) 499 cmd = ATA_CMD_ID_ATA;
500 rc = do_probe(drive, cmd);
501 if (rc >= 2) {
508 /* look for ATAPI device */ 502 /* look for ATAPI device */
509 (void)do_probe(drive, ATA_CMD_ID_ATAPI); 503 cmd = ATA_CMD_ID_ATAPI;
504 rc = do_probe(drive, cmd);
505 }
510 506
511 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) 507 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
512 /* drive not found */ 508 /* drive not found */
@@ -525,8 +521,12 @@ static u8 probe_for_drive(ide_drive_t *drive)
525 printk(KERN_WARNING "%s: Unknown device on bus refused identification. Ignoring.\n", drive->name); 521 printk(KERN_WARNING "%s: Unknown device on bus refused identification. Ignoring.\n", drive->name);
526 drive->dev_flags &= ~IDE_DFLAG_PRESENT; 522 drive->dev_flags &= ~IDE_DFLAG_PRESENT;
527 } 523 }
524 } else {
525 if (cmd == ATA_CMD_ID_ATAPI)
526 ide_classify_atapi_dev(drive);
527 else
528 ide_classify_ata_dev(drive);
528 } 529 }
529 /* drive was found */
530 } 530 }
531 531
532 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) 532 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)