diff options
author | Kiyoshi Ueda <k-ueda@ct.jp.nec.com> | 2007-12-11 17:42:27 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-01-28 04:35:59 -0500 |
commit | 650e9cfd14a1ac9e077d72962ea0a80946cdb6f8 (patch) | |
tree | c2ebc29c809a04e0d450b09c927892b8bd6202aa /arch/arm | |
parent | 9e6e39f2c478fff2e9d3430cdfe6730877942ed6 (diff) |
blk_end_request: changing arm (take 4)
This patch converts arm's OMAP mailbox driver to use
blk_end_request interfaces.
If the original code was converted literally, blk_end_request would
be called with '-EIO' because end_that_request_last() were called
with '0' (i.e. failure).
But I think these '0's are bugs in the original code because it's
unlikely that all requests are treated as failure.
(The bugs should have no effect unless these requests have an end_io
callback.)
So I changed them to pass '0' (i.e. success) to blk_end_request.
Cc: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
Cc: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/plat-omap/mailbox.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index 0360b1f14d11..65e9c26f2054 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c | |||
@@ -116,8 +116,8 @@ static void mbox_tx_work(struct work_struct *work) | |||
116 | } | 116 | } |
117 | 117 | ||
118 | spin_lock(q->queue_lock); | 118 | spin_lock(q->queue_lock); |
119 | blkdev_dequeue_request(rq); | 119 | if (__blk_end_request(rq, 0, 0)) |
120 | end_that_request_last(rq, 0); | 120 | BUG(); |
121 | spin_unlock(q->queue_lock); | 121 | spin_unlock(q->queue_lock); |
122 | } | 122 | } |
123 | } | 123 | } |
@@ -149,10 +149,8 @@ static void mbox_rx_work(struct work_struct *work) | |||
149 | 149 | ||
150 | msg = (mbox_msg_t) rq->data; | 150 | msg = (mbox_msg_t) rq->data; |
151 | 151 | ||
152 | spin_lock_irqsave(q->queue_lock, flags); | 152 | if (blk_end_request(rq, 0, 0)) |
153 | blkdev_dequeue_request(rq); | 153 | BUG(); |
154 | end_that_request_last(rq, 0); | ||
155 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
156 | 154 | ||
157 | mbox->rxq->callback((void *)msg); | 155 | mbox->rxq->callback((void *)msg); |
158 | } | 156 | } |
@@ -263,10 +261,8 @@ omap_mbox_read(struct device *dev, struct device_attribute *attr, char *buf) | |||
263 | 261 | ||
264 | *p = (mbox_msg_t) rq->data; | 262 | *p = (mbox_msg_t) rq->data; |
265 | 263 | ||
266 | spin_lock_irqsave(q->queue_lock, flags); | 264 | if (blk_end_request(rq, 0, 0)) |
267 | blkdev_dequeue_request(rq); | 265 | BUG(); |
268 | end_that_request_last(rq, 0); | ||
269 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
270 | 266 | ||
271 | if (unlikely(mbox_seq_test(mbox, *p))) { | 267 | if (unlikely(mbox_seq_test(mbox, *p))) { |
272 | pr_info("mbox: Illegal seq bit!(%08x) ignored\n", *p); | 268 | pr_info("mbox: Illegal seq bit!(%08x) ignored\n", *p); |