diff options
Diffstat (limited to 'drivers/sbus/char/jsflash.c')
-rw-r--r-- | drivers/sbus/char/jsflash.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c index a85ad05e8548..6d4651684688 100644 --- a/drivers/sbus/char/jsflash.c +++ b/drivers/sbus/char/jsflash.c | |||
@@ -186,31 +186,31 @@ static void jsfd_do_request(struct request_queue *q) | |||
186 | { | 186 | { |
187 | struct request *req; | 187 | struct request *req; |
188 | 188 | ||
189 | while ((req = elv_next_request(q)) != NULL) { | 189 | req = blk_fetch_request(q); |
190 | while (req) { | ||
190 | struct jsfd_part *jdp = req->rq_disk->private_data; | 191 | struct jsfd_part *jdp = req->rq_disk->private_data; |
191 | unsigned long offset = req->sector << 9; | 192 | unsigned long offset = blk_rq_pos(req) << 9; |
192 | size_t len = req->current_nr_sectors << 9; | 193 | size_t len = blk_rq_cur_bytes(req); |
194 | int err = -EIO; | ||
193 | 195 | ||
194 | if ((offset + len) > jdp->dsize) { | 196 | if ((offset + len) > jdp->dsize) |
195 | end_request(req, 0); | 197 | goto end; |
196 | continue; | ||
197 | } | ||
198 | 198 | ||
199 | if (rq_data_dir(req) != READ) { | 199 | if (rq_data_dir(req) != READ) { |
200 | printk(KERN_ERR "jsfd: write\n"); | 200 | printk(KERN_ERR "jsfd: write\n"); |
201 | end_request(req, 0); | 201 | goto end; |
202 | continue; | ||
203 | } | 202 | } |
204 | 203 | ||
205 | if ((jdp->dbase & 0xff000000) != 0x20000000) { | 204 | if ((jdp->dbase & 0xff000000) != 0x20000000) { |
206 | printk(KERN_ERR "jsfd: bad base %x\n", (int)jdp->dbase); | 205 | printk(KERN_ERR "jsfd: bad base %x\n", (int)jdp->dbase); |
207 | end_request(req, 0); | 206 | goto end; |
208 | continue; | ||
209 | } | 207 | } |
210 | 208 | ||
211 | jsfd_read(req->buffer, jdp->dbase + offset, len); | 209 | jsfd_read(req->buffer, jdp->dbase + offset, len); |
212 | 210 | err = 0; | |
213 | end_request(req, 1); | 211 | end: |
212 | if (!__blk_end_request_cur(req, err)) | ||
213 | req = blk_fetch_request(q); | ||
214 | } | 214 | } |
215 | } | 215 | } |
216 | 216 | ||