diff options
author | Tejun Heo <htejun@gmail.com> | 2006-02-02 04:20:00 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-09 01:59:52 -0500 |
commit | 7944ea9522ce0ea32d57894b3dc2540b0bdca66e (patch) | |
tree | ad45c0cccefa40c2b91fbeee6bfa156fa04aeeb4 /drivers | |
parent | 5140788f77d71b4f05fde217adbfb0c92f28f20c (diff) |
[PATCH] libata: add probeinit component operation to ata_drive_probe_reset()
This patch adds probeinit component operation to
ata_drive_probe_reset(). If present, this new operation is called
before performing any reset. The operations's roll is to prepare @ap
for following probe-reset operations.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/libata-core.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 99f4bf6022ee..c36c5a9a4617 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -2485,7 +2485,8 @@ int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes) | |||
2485 | if (ap->flags & ATA_FLAG_SATA && ap->ops->scr_read) | 2485 | if (ap->flags & ATA_FLAG_SATA && ap->ops->scr_read) |
2486 | hardreset = sata_std_hardreset; | 2486 | hardreset = sata_std_hardreset; |
2487 | 2487 | ||
2488 | return ata_drive_probe_reset(ap, ata_std_softreset, hardreset, | 2488 | return ata_drive_probe_reset(ap, NULL, |
2489 | ata_std_softreset, hardreset, | ||
2489 | ata_std_postreset, classes); | 2490 | ata_std_postreset, classes); |
2490 | } | 2491 | } |
2491 | 2492 | ||
@@ -2524,6 +2525,7 @@ static int do_probe_reset(struct ata_port *ap, ata_reset_fn_t reset, | |||
2524 | /** | 2525 | /** |
2525 | * ata_drive_probe_reset - Perform probe reset with given methods | 2526 | * ata_drive_probe_reset - Perform probe reset with given methods |
2526 | * @ap: port to reset | 2527 | * @ap: port to reset |
2528 | * @probeinit: probeinit method (can be NULL) | ||
2527 | * @softreset: softreset method (can be NULL) | 2529 | * @softreset: softreset method (can be NULL) |
2528 | * @hardreset: hardreset method (can be NULL) | 2530 | * @hardreset: hardreset method (can be NULL) |
2529 | * @postreset: postreset method (can be NULL) | 2531 | * @postreset: postreset method (can be NULL) |
@@ -2552,12 +2554,15 @@ static int do_probe_reset(struct ata_port *ap, ata_reset_fn_t reset, | |||
2552 | * if classification fails, and any error code from reset | 2554 | * if classification fails, and any error code from reset |
2553 | * methods. | 2555 | * methods. |
2554 | */ | 2556 | */ |
2555 | int ata_drive_probe_reset(struct ata_port *ap, | 2557 | int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit, |
2556 | ata_reset_fn_t softreset, ata_reset_fn_t hardreset, | 2558 | ata_reset_fn_t softreset, ata_reset_fn_t hardreset, |
2557 | ata_postreset_fn_t postreset, unsigned int *classes) | 2559 | ata_postreset_fn_t postreset, unsigned int *classes) |
2558 | { | 2560 | { |
2559 | int rc = -EINVAL; | 2561 | int rc = -EINVAL; |
2560 | 2562 | ||
2563 | if (probeinit) | ||
2564 | probeinit(ap); | ||
2565 | |||
2561 | if (softreset) { | 2566 | if (softreset) { |
2562 | rc = do_probe_reset(ap, softreset, postreset, classes); | 2567 | rc = do_probe_reset(ap, softreset, postreset, classes); |
2563 | if (rc == 0) | 2568 | if (rc == 0) |