aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-24 18:22:58 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-24 18:22:58 -0400
commit1bd4c1f4fe6607a0253d1318847b618a2a598612 (patch)
tree6411b5d55f502a5fbae5841a22d4fdd78ab0b4e3 /drivers/ide/ide-probe.c
parent552d3a99bdce8a0d7f9abe3766fb3655ef5757dc (diff)
ide: classify device type in do_probe()
Defer classifying device type from do_identify() to do_probe(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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)