diff options
-rw-r--r-- | drivers/scsi/libata-core.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 6a336babf88b..559abe4ea4e9 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -2371,16 +2371,16 @@ int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes) | |||
2371 | ata_std_postreset, classes); | 2371 | ata_std_postreset, classes); |
2372 | } | 2372 | } |
2373 | 2373 | ||
2374 | static int do_probe_reset(struct ata_port *ap, ata_reset_fn_t reset, | 2374 | static int ata_do_reset(struct ata_port *ap, |
2375 | ata_postreset_fn_t postreset, | 2375 | ata_reset_fn_t reset, ata_postreset_fn_t postreset, |
2376 | unsigned int *classes) | 2376 | int verbose, unsigned int *classes) |
2377 | { | 2377 | { |
2378 | int i, rc; | 2378 | int i, rc; |
2379 | 2379 | ||
2380 | for (i = 0; i < ATA_MAX_DEVICES; i++) | 2380 | for (i = 0; i < ATA_MAX_DEVICES; i++) |
2381 | classes[i] = ATA_DEV_UNKNOWN; | 2381 | classes[i] = ATA_DEV_UNKNOWN; |
2382 | 2382 | ||
2383 | rc = reset(ap, 0, classes); | 2383 | rc = reset(ap, verbose, classes); |
2384 | if (rc) | 2384 | if (rc) |
2385 | return rc; | 2385 | return rc; |
2386 | 2386 | ||
@@ -2400,7 +2400,7 @@ static int do_probe_reset(struct ata_port *ap, ata_reset_fn_t reset, | |||
2400 | if (postreset) | 2400 | if (postreset) |
2401 | postreset(ap, classes); | 2401 | postreset(ap, classes); |
2402 | 2402 | ||
2403 | return classes[0] != ATA_DEV_UNKNOWN ? 0 : -ENODEV; | 2403 | return 0; |
2404 | } | 2404 | } |
2405 | 2405 | ||
2406 | /** | 2406 | /** |
@@ -2445,21 +2445,24 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit, | |||
2445 | probeinit(ap); | 2445 | probeinit(ap); |
2446 | 2446 | ||
2447 | if (softreset) { | 2447 | if (softreset) { |
2448 | rc = do_probe_reset(ap, softreset, postreset, classes); | 2448 | rc = ata_do_reset(ap, softreset, postreset, 0, classes); |
2449 | if (rc == 0) | 2449 | if (rc == 0 && classes[0] != ATA_DEV_UNKNOWN) |
2450 | return 0; | 2450 | goto done; |
2451 | } | 2451 | } |
2452 | 2452 | ||
2453 | if (!hardreset) | 2453 | if (!hardreset) |
2454 | return rc; | 2454 | goto done; |
2455 | 2455 | ||
2456 | rc = do_probe_reset(ap, hardreset, postreset, classes); | 2456 | rc = ata_do_reset(ap, hardreset, postreset, 0, classes); |
2457 | if (rc == 0 || rc != -ENODEV) | 2457 | if (rc || classes[0] != ATA_DEV_UNKNOWN) |
2458 | return rc; | 2458 | goto done; |
2459 | 2459 | ||
2460 | if (softreset) | 2460 | if (softreset) |
2461 | rc = do_probe_reset(ap, softreset, postreset, classes); | 2461 | rc = ata_do_reset(ap, softreset, postreset, 0, classes); |
2462 | 2462 | ||
2463 | done: | ||
2464 | if (rc == 0 && classes[0] == ATA_DEV_UNKNOWN) | ||
2465 | rc = -ENODEV; | ||
2463 | return rc; | 2466 | return rc; |
2464 | } | 2467 | } |
2465 | 2468 | ||