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.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index a3edbb5d0452..4b00945cf7d1 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -228,15 +228,9 @@ static void do_identify(ide_drive_t *drive, u8 cmd, u16 *id)
228 m[ATA_ID_PROD_LEN - 1] = '\0'; 228 m[ATA_ID_PROD_LEN - 1] = '\0';
229 229
230 if (strstr(m, "E X A B Y T E N E S T")) 230 if (strstr(m, "E X A B Y T E N E S T"))
231 goto err_misc; 231 drive->dev_flags &= ~IDE_DFLAG_PRESENT;
232 232 else
233 drive->dev_flags |= IDE_DFLAG_PRESENT; 233 drive->dev_flags |= IDE_DFLAG_PRESENT;
234 drive->dev_flags &= ~IDE_DFLAG_DEAD;
235
236 return;
237err_misc:
238 kfree(id);
239 drive->dev_flags &= ~IDE_DFLAG_PRESENT;
240} 234}
241 235
242/** 236/**
@@ -505,8 +499,7 @@ static u8 probe_for_drive(ide_drive_t *drive)
505 } 499 }
506 500
507 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) 501 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
508 /* drive not found */ 502 goto out_free;
509 return 0;
510 503
511 /* identification failed? */ 504 /* identification failed? */
512 if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0) { 505 if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0) {
@@ -530,7 +523,7 @@ static u8 probe_for_drive(ide_drive_t *drive)
530 } 523 }
531 524
532 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) 525 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
533 return 0; 526 goto out_free;
534 527
535 /* The drive wasn't being helpful. Add generic info only */ 528 /* The drive wasn't being helpful. Add generic info only */
536 if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0) { 529 if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0) {
@@ -543,7 +536,10 @@ static u8 probe_for_drive(ide_drive_t *drive)
543 ide_disk_init_mult_count(drive); 536 ide_disk_init_mult_count(drive);
544 } 537 }
545 538
546 return !!(drive->dev_flags & IDE_DFLAG_PRESENT); 539 return 1;
540out_free:
541 kfree(drive->id);
542 return 0;
547} 543}
548 544
549static void hwif_release_dev(struct device *dev) 545static void hwif_release_dev(struct device *dev)