diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-24 18:22:58 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-24 18:22:58 -0400 |
commit | 1bd4c1f4fe6607a0253d1318847b618a2a598612 (patch) | |
tree | 6411b5d55f502a5fbae5841a22d4fdd78ab0b4e3 /drivers/ide | |
parent | 552d3a99bdce8a0d7f9abe3766fb3655ef5757dc (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')
-rw-r--r-- | drivers/ide/ide-probe.c | 26 |
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; |
247 | err_misc: | 237 | err_misc: |
248 | kfree(id); | 238 | kfree(id); |
@@ -480,6 +470,8 @@ static int do_probe (ide_drive_t *drive, u8 cmd) | |||
480 | static u8 probe_for_drive(ide_drive_t *drive) | 470 | static 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) |