]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/sbus/char/jsflash.c
block: convert to pos and nr_sectors accessors
[mirror_ubuntu-zesty-kernel.git] / drivers / sbus / char / jsflash.c
index a85ad05e85482a96d774358123b88e3401a50d0b..2132c906e53a4cf34dfe4ac1243224dd5908a1ef 100644 (file)
@@ -188,29 +188,29 @@ static void jsfd_do_request(struct request_queue *q)
 
        while ((req = elv_next_request(q)) != NULL) {
                struct jsfd_part *jdp = req->rq_disk->private_data;
-               unsigned long offset = req->sector << 9;
-               size_t len = req->current_nr_sectors << 9;
+               unsigned long offset = blk_rq_pos(req) << 9;
+               size_t len = blk_rq_cur_sectors(req) << 9;
 
                if ((offset + len) > jdp->dsize) {
-                               end_request(req, 0);
+                       __blk_end_request_cur(req, -EIO);
                        continue;
                }
 
                if (rq_data_dir(req) != READ) {
                        printk(KERN_ERR "jsfd: write\n");
-                       end_request(req, 0);
+                       __blk_end_request_cur(req, -EIO);
                        continue;
                }
 
                if ((jdp->dbase & 0xff000000) != 0x20000000) {
                        printk(KERN_ERR "jsfd: bad base %x\n", (int)jdp->dbase);
-                       end_request(req, 0);
+                       __blk_end_request_cur(req, -EIO);
                        continue;
                }
 
                jsfd_read(req->buffer, jdp->dbase + offset, len);
 
-               end_request(req, 1);
+               __blk_end_request_cur(req, 0);
        }
 }