block: replace end_request() with [__]blk_end_request_cur()
[deliverable/linux.git] / drivers / block / xd.c
index 64b496fce98bb2a19fd17eb22ef5a192f67ae7bb..6f6ad82ec0c0ab7de8e46324f7f8d79c1841656b 100644 (file)
@@ -314,21 +314,22 @@ static void do_xd_request (struct request_queue * q)
                int retry;
 
                if (!blk_fs_request(req)) {
-                       end_request(req, 0);
+                       __blk_end_request_cur(req, -EIO);
                        continue;
                }
                if (block + count > get_capacity(req->rq_disk)) {
-                       end_request(req, 0);
+                       __blk_end_request_cur(req, -EIO);
                        continue;
                }
                if (rw != READ && rw != WRITE) {
                        printk("do_xd_request: unknown request\n");
-                       end_request(req, 0);
+                       __blk_end_request_cur(req, -EIO);
                        continue;
                }
                for (retry = 0; (retry < XD_RETRIES) && !res; retry++)
                        res = xd_readwrite(rw, disk, req->buffer, block, count);
-               end_request(req, res);  /* wrap up, 0 = fail, 1 = success */
+               /* wrap up, 0 = success, -errno = fail */
+               __blk_end_request_cur(req, res);
        }
 }
 
@@ -418,7 +419,7 @@ static int xd_readwrite (u_char operation,XD_INFO *p,char *buffer,u_int block,u_
                                printk("xd%c: %s timeout, recalibrating drive\n",'a'+drive,(operation == READ ? "read" : "write"));
                                xd_recalibrate(drive);
                                spin_lock_irq(&xd_lock);
-                               return (0);
+                               return -EIO;
                        case 2:
                                if (sense[0] & 0x30) {
                                        printk("xd%c: %s - ",'a'+drive,(operation == READ ? "reading" : "writing"));
@@ -439,7 +440,7 @@ static int xd_readwrite (u_char operation,XD_INFO *p,char *buffer,u_int block,u_
                                else
                                        printk(" - no valid disk address\n");
                                spin_lock_irq(&xd_lock);
-                               return (0);
+                               return -EIO;
                }
                if (xd_dma_buffer)
                        for (i=0; i < (temp * 0x200); i++)
@@ -448,7 +449,7 @@ static int xd_readwrite (u_char operation,XD_INFO *p,char *buffer,u_int block,u_
                count -= temp, buffer += temp * 0x200, block += temp;
        }
        spin_lock_irq(&xd_lock);
-       return (1);
+       return 0;
 }
 
 /* xd_recalibrate: recalibrate a given drive and reset controller if necessary */
This page took 0.110813 seconds and 5 git commands to generate.