diff options
author | Tejun Heo <htejun@gmail.com> | 2006-05-15 07:57:38 -0400 |
---|---|---|
committer | Tejun Heo <htejun@gmail.com> | 2006-05-15 07:57:38 -0400 |
commit | 96bd39ec295e49443c8b0c25a6b69fdace18780f (patch) | |
tree | 02b80f3a37f3b75b68f41e6243fab513aed30b32 /drivers | |
parent | 3adcebb2b59d590d572844815c906ca30477b14a (diff) |
[PATCH] libata: remove postreset handling from ata_do_reset()
Make ata_do_reset() deal only with reset. postreset is now the
responsibility of the caller. This is simpler and eases later
prereset addition.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/libata-core.c | 19 | ||||
-rw-r--r-- | drivers/scsi/libata.h | 2 |
2 files changed, 11 insertions, 10 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 1efe8a1ba81d..19ae3fa1cfcb 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -2585,7 +2585,7 @@ int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes) | |||
2585 | } | 2585 | } |
2586 | 2586 | ||
2587 | int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset, | 2587 | int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset, |
2588 | ata_postreset_fn_t postreset, unsigned int *classes) | 2588 | unsigned int *classes) |
2589 | { | 2589 | { |
2590 | int i, rc; | 2590 | int i, rc; |
2591 | 2591 | ||
@@ -2609,9 +2609,6 @@ int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset, | |||
2609 | if (classes[i] == ATA_DEV_UNKNOWN) | 2609 | if (classes[i] == ATA_DEV_UNKNOWN) |
2610 | classes[i] = ATA_DEV_NONE; | 2610 | classes[i] = ATA_DEV_NONE; |
2611 | 2611 | ||
2612 | if (postreset) | ||
2613 | postreset(ap, classes); | ||
2614 | |||
2615 | return 0; | 2612 | return 0; |
2616 | } | 2613 | } |
2617 | 2614 | ||
@@ -2655,7 +2652,7 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit, | |||
2655 | probeinit(ap); | 2652 | probeinit(ap); |
2656 | 2653 | ||
2657 | if (softreset && !sata_set_spd_needed(ap)) { | 2654 | if (softreset && !sata_set_spd_needed(ap)) { |
2658 | rc = ata_do_reset(ap, softreset, postreset, classes); | 2655 | rc = ata_do_reset(ap, softreset, classes); |
2659 | if (rc == 0 && classes[0] != ATA_DEV_UNKNOWN) | 2656 | if (rc == 0 && classes[0] != ATA_DEV_UNKNOWN) |
2660 | goto done; | 2657 | goto done; |
2661 | printk(KERN_INFO "ata%u: softreset failed, will try " | 2658 | printk(KERN_INFO "ata%u: softreset failed, will try " |
@@ -2667,7 +2664,7 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit, | |||
2667 | goto done; | 2664 | goto done; |
2668 | 2665 | ||
2669 | while (1) { | 2666 | while (1) { |
2670 | rc = ata_do_reset(ap, hardreset, postreset, classes); | 2667 | rc = ata_do_reset(ap, hardreset, classes); |
2671 | if (rc == 0) { | 2668 | if (rc == 0) { |
2672 | if (classes[0] != ATA_DEV_UNKNOWN) | 2669 | if (classes[0] != ATA_DEV_UNKNOWN) |
2673 | goto done; | 2670 | goto done; |
@@ -2688,12 +2685,16 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit, | |||
2688 | ap->id); | 2685 | ap->id); |
2689 | ssleep(5); | 2686 | ssleep(5); |
2690 | 2687 | ||
2691 | rc = ata_do_reset(ap, softreset, postreset, classes); | 2688 | rc = ata_do_reset(ap, softreset, classes); |
2692 | } | 2689 | } |
2693 | 2690 | ||
2694 | done: | 2691 | done: |
2695 | if (rc == 0 && classes[0] == ATA_DEV_UNKNOWN) | 2692 | if (rc == 0) { |
2696 | rc = -ENODEV; | 2693 | if (postreset) |
2694 | postreset(ap, classes); | ||
2695 | if (classes[0] == ATA_DEV_UNKNOWN) | ||
2696 | rc = -ENODEV; | ||
2697 | } | ||
2697 | return rc; | 2698 | return rc; |
2698 | } | 2699 | } |
2699 | 2700 | ||
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h index 26975df9a3fc..6442c2f1a80c 100644 --- a/drivers/scsi/libata.h +++ b/drivers/scsi/libata.h | |||
@@ -57,7 +57,7 @@ extern int ata_down_xfermask_limit(struct ata_port *ap, struct ata_device *dev, | |||
57 | int force_pio0); | 57 | int force_pio0); |
58 | extern int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev); | 58 | extern int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev); |
59 | extern int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset, | 59 | extern int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset, |
60 | ata_postreset_fn_t postreset, unsigned int *classes); | 60 | unsigned int *classes); |
61 | extern void ata_qc_free(struct ata_queued_cmd *qc); | 61 | extern void ata_qc_free(struct ata_queued_cmd *qc); |
62 | extern void ata_qc_issue(struct ata_queued_cmd *qc); | 62 | extern void ata_qc_issue(struct ata_queued_cmd *qc); |
63 | extern int ata_check_atapi_dma(struct ata_queued_cmd *qc); | 63 | extern int ata_check_atapi_dma(struct ata_queued_cmd *qc); |