diff options
author | Jiri Slaby <jslaby@suse.cz> | 2019-10-31 12:59:45 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-11-01 17:50:51 +0300 |
commit | 95364f36701e62dd50eee91e1303187fd1a9f567 (patch) | |
tree | 3ba901b8f53c7c667cc1210ee727e5b63d62382b /drivers/ata/libata-core.c | |
parent | 25937580a5065d6fbd92d9c8ebd47145ad80052e (diff) | |
download | linux-95364f36701e62dd50eee91e1303187fd1a9f567.tar.xz |
ata: make qc_prep return ata_completion_errors
In case a driver wants to return an error from qc_prep, return enum
ata_completion_errors. sata_mv is one of those drivers -- see the next
patch. Other drivers return the newly defined AC_ERR_OK.
[v2] use enum ata_completion_errors and AC_ERR_OK.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-ide@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 74c9b3032d46..e9017c570bc5 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4980,7 +4980,10 @@ int ata_std_qc_defer(struct ata_queued_cmd *qc) return ATA_DEFER_LINK; } -void ata_noop_qc_prep(struct ata_queued_cmd *qc) { } +enum ata_completion_errors ata_noop_qc_prep(struct ata_queued_cmd *qc) +{ + return AC_ERR_OK; +} /** * ata_sg_init - Associate command with scatter-gather table. @@ -5443,7 +5446,9 @@ void ata_qc_issue(struct ata_queued_cmd *qc) return; } - ap->ops->qc_prep(qc); + qc->err_mask |= ap->ops->qc_prep(qc); + if (unlikely(qc->err_mask)) + goto err; trace_ata_qc_issue(qc); qc->err_mask |= ap->ops->qc_issue(qc); if (unlikely(qc->err_mask)) |