aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cdrom
diff options
context:
space:
mode:
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>2008-10-01 10:13:02 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:56:21 -0400
commit7afb3a6e752503d5ebeb038336aa0fa886a51b44 (patch)
treee2797bd14291211e364adf255e50e8b5e4f3bc7b /drivers/cdrom
parent2a9df5055a99df25533daf4041fdb99f0ed3463c (diff)
gdrom: change to use __blk_end_request()
This patch converts gdrom to use __blk_end_request() directly so that end_{queued|dequeued}_request() can be removed. gd.transfer is '1' in error cases and '0' in non-error cases, so gdrom hasn't been propagating any error code to the block layer. We can just convert error cases to '-EIO'. Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Cc: Adrian McMenamin <adrian@mcmen.demon.co.uk> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/cdrom')
-rw-r--r--drivers/cdrom/gdrom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index 1231d95aa695..d6ba77a2dd7b 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -624,14 +624,14 @@ static void gdrom_readdisk_dma(struct work_struct *work)
624 ctrl_outb(1, GDROM_DMA_STATUS_REG); 624 ctrl_outb(1, GDROM_DMA_STATUS_REG);
625 wait_event_interruptible_timeout(request_queue, 625 wait_event_interruptible_timeout(request_queue,
626 gd.transfer == 0, GDROM_DEFAULT_TIMEOUT); 626 gd.transfer == 0, GDROM_DEFAULT_TIMEOUT);
627 err = gd.transfer; 627 err = gd.transfer ? -EIO : 0;
628 gd.transfer = 0; 628 gd.transfer = 0;
629 gd.pending = 0; 629 gd.pending = 0;
630 /* now seek to take the request spinlock 630 /* now seek to take the request spinlock
631 * before handling ending the request */ 631 * before handling ending the request */
632 spin_lock(&gdrom_lock); 632 spin_lock(&gdrom_lock);
633 list_del_init(&req->queuelist); 633 list_del_init(&req->queuelist);
634 end_dequeued_request(req, 1 - err); 634 __blk_end_request(req, err, blk_rq_bytes(req));
635 } 635 }
636 spin_unlock(&gdrom_lock); 636 spin_unlock(&gdrom_lock);
637 kfree(read_command); 637 kfree(read_command);