diff options
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 82c33a6edbea..21225d62b0c1 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -177,7 +177,7 @@ typedef struct sg_device { /* holds the state of each scsi generic device */ | |||
177 | } Sg_device; | 177 | } Sg_device; |
178 | 178 | ||
179 | /* tasklet or soft irq callback */ | 179 | /* tasklet or soft irq callback */ |
180 | static void sg_rq_end_io(struct request *rq, int uptodate); | 180 | static void sg_rq_end_io(struct request *rq, blk_status_t status); |
181 | static int sg_start_req(Sg_request *srp, unsigned char *cmd); | 181 | static int sg_start_req(Sg_request *srp, unsigned char *cmd); |
182 | static int sg_finish_rem_req(Sg_request * srp); | 182 | static int sg_finish_rem_req(Sg_request * srp); |
183 | static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size); | 183 | static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size); |
@@ -808,7 +808,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp, | |||
808 | if (atomic_read(&sdp->detaching)) { | 808 | if (atomic_read(&sdp->detaching)) { |
809 | if (srp->bio) { | 809 | if (srp->bio) { |
810 | scsi_req_free_cmd(scsi_req(srp->rq)); | 810 | scsi_req_free_cmd(scsi_req(srp->rq)); |
811 | blk_end_request_all(srp->rq, -EIO); | 811 | blk_end_request_all(srp->rq, BLK_STS_IOERR); |
812 | srp->rq = NULL; | 812 | srp->rq = NULL; |
813 | } | 813 | } |
814 | 814 | ||
@@ -1300,7 +1300,7 @@ sg_rq_end_io_usercontext(struct work_struct *work) | |||
1300 | * level when a command is completed (or has failed). | 1300 | * level when a command is completed (or has failed). |
1301 | */ | 1301 | */ |
1302 | static void | 1302 | static void |
1303 | sg_rq_end_io(struct request *rq, int uptodate) | 1303 | sg_rq_end_io(struct request *rq, blk_status_t status) |
1304 | { | 1304 | { |
1305 | struct sg_request *srp = rq->end_io_data; | 1305 | struct sg_request *srp = rq->end_io_data; |
1306 | struct scsi_request *req = scsi_req(rq); | 1306 | struct scsi_request *req = scsi_req(rq); |
@@ -1732,8 +1732,6 @@ sg_start_req(Sg_request *srp, unsigned char *cmd) | |||
1732 | } | 1732 | } |
1733 | req = scsi_req(rq); | 1733 | req = scsi_req(rq); |
1734 | 1734 | ||
1735 | scsi_req_init(rq); | ||
1736 | |||
1737 | if (hp->cmd_len > BLK_MAX_CDB) | 1735 | if (hp->cmd_len > BLK_MAX_CDB) |
1738 | req->cmd = long_cmdp; | 1736 | req->cmd = long_cmdp; |
1739 | memcpy(req->cmd, cmd, hp->cmd_len); | 1737 | memcpy(req->cmd, cmd, hp->cmd_len); |