ide-cd: use ide_end_rq() also for failed non-fs requests
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 31 Mar 2009 18:15:00 +0000 (20:15 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 31 Mar 2009 18:15:00 +0000 (20:15 +0200)
Use ide_end_rq() also for failed non-fs requests on completion
of REQUEST SENSE requests + use blk_rq_bytes() while at it.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-cd.c

index a71ca2a9ab4b0682d15ff3dc72f9816fd25e97d0..6f64fb2f63d0eab571add20dbfbe0f431b80208d 100644 (file)
@@ -265,18 +265,10 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
                                failed->sense_len = rq->sense_len;
                        }
                        cdrom_analyze_sense_data(drive, failed, sense);
-                       /*
-                        * now end the failed request
-                        */
-                       if (blk_fs_request(failed)) {
-                               if (ide_end_rq(drive, failed, -EIO,
-                                               failed->hard_nr_sectors << 9))
-                                       BUG();
-                       } else {
-                               if (blk_end_request(failed, -EIO,
-                                                   failed->data_len))
-                                       BUG();
-                       }
+
+                       if (ide_end_rq(drive, failed, -EIO,
+                                      blk_rq_bytes(failed)))
+                               BUG();
                } else
                        cdrom_analyze_sense_data(drive, NULL, sense);
        }