]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ide: remove ->end_request method
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:36 +0000 (12:46 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:36 +0000 (12:46 +0100)
* Handle completion of private driver requests explicitly
  for ide_floppy and ide_tape media in ide_kill_rq().

* Remove no longer needed ->end_request method.

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-cd.c
drivers/ide/ide-disk.c
drivers/ide/ide-floppy.c
drivers/ide/ide-gd.c
drivers/ide/ide-io.c
drivers/ide/ide-tape.c
include/linux/ide.h

index 4528e25f2bbb7c90068f945949f1ed3e92a997f3..bb804ae57bc5c3a96891933ea7f7e3ffc1ac2c9d 100644 (file)
@@ -1834,7 +1834,6 @@ static struct ide_driver ide_cdrom_driver = {
        .remove                 = ide_cd_remove,
        .version                = IDECD_VERSION,
        .do_request             = ide_cd_do_request,
-       .end_request            = ide_end_request,
 #ifdef CONFIG_IDE_PROC_FS
        .proc_entries           = ide_cd_proc_entries,
        .proc_devsets           = ide_cd_proc_devsets,
index 0f196e5fcff39aa0155b6ebf75561f526020f6f9..912be155a8c16207419c8de23ab9f68864ba884e 100644 (file)
@@ -734,6 +734,5 @@ const struct ide_disk_ops ide_ata_disk_ops = {
        .init_media     = ide_disk_init_media,
        .set_doorlock   = ide_disk_set_doorlock,
        .do_request     = ide_do_rw_disk,
-       .end_request    = ide_end_request,
        .ioctl          = ide_disk_ioctl,
 };
index bdd8f8e2df6dc21561e5c4508839f172e79aa156..ab870a08d62b698f3ab98d7c7b3b9b78aa059c8d 100644 (file)
  */
 #define IDEFLOPPY_PC_DELAY     (HZ/20) /* default delay for ZIP 100 (50ms) */
 
-/*
- * Used to finish servicing a private request.
- */
-static int ide_floppy_end_request(ide_drive_t *drive, int uptodate, int nsecs)
-{
-       struct request *rq = drive->hwif->rq;
-
-       ide_debug_log(IDE_DBG_FUNC, "enter");
-
-       if (uptodate == 0)
-               drive->failed_pc = NULL;
-
-       rq->errors = uptodate ? 0 : IDE_DRV_ERROR_GENERAL;
-
-       ide_complete_rq(drive, 0);
-
-       return 0;
-}
-
 static void idefloppy_update_buffers(ide_drive_t *drive,
                                struct ide_atapi_pc *pc)
 {
@@ -560,6 +541,5 @@ const struct ide_disk_ops ide_atapi_disk_ops = {
        .init_media     = ide_floppy_init_media,
        .set_doorlock   = ide_set_media_lock,
        .do_request     = ide_floppy_do_request,
-       .end_request    = ide_floppy_end_request,
        .ioctl          = ide_floppy_ioctl,
 };
index c51a35093ae2604d95946e0e904205bc762062f9..1aebdf1a4f5866a4c6d0f430274e66d1ce3e6022 100644 (file)
@@ -145,11 +145,6 @@ static ide_startstop_t ide_gd_do_request(ide_drive_t *drive,
        return drive->disk_ops->do_request(drive, rq, sector);
 }
 
-static int ide_gd_end_request(ide_drive_t *drive, int uptodate, int nrsecs)
-{
-       return drive->disk_ops->end_request(drive, uptodate, nrsecs);
-}
-
 static struct ide_driver ide_gd_driver = {
        .gen_driver = {
                .owner          = THIS_MODULE,
@@ -162,7 +157,6 @@ static struct ide_driver ide_gd_driver = {
        .shutdown               = ide_gd_shutdown,
        .version                = IDE_GD_VERSION,
        .do_request             = ide_gd_do_request,
-       .end_request            = ide_gd_end_request,
 #ifdef CONFIG_IDE_PROC_FS
        .proc_entries           = ide_disk_proc_entries,
        .proc_devsets           = ide_disk_proc_devsets,
index da2f97dfa8f8d2ee729d1ff6d2b5605dc924aade..6eee41beec732e635bc265aa40e2269b0a02f6cf 100644 (file)
@@ -178,17 +178,17 @@ EXPORT_SYMBOL(ide_complete_rq);
 
 void ide_kill_rq(ide_drive_t *drive, struct request *rq)
 {
+       u8 drv_req = blk_special_request(rq) && rq->rq_disk;
+       u8 media = drive->media;
+
        drive->failed_pc = NULL;
 
-       if (drive->media == ide_tape)
+       if ((media == ide_floppy && drv_req) || media == ide_tape)
                rq->errors = IDE_DRV_ERROR_GENERAL;
 
-       if (blk_special_request(rq) && rq->rq_disk) {
-               struct ide_driver *drv;
-
-               drv = *(struct ide_driver **)rq->rq_disk->private_data;
-               drv->end_request(drive, 0, 0);
-       } else
+       if ((media == ide_floppy || media == ide_tape) && drv_req)
+               ide_complete_rq(drive, 0);
+       else
                ide_end_request(drive, 0, 0);
 }
 
index 35469f3069a2da3d447f37338b9798683e94f4b4..fc61bbef3bb940a78e088eaf75e31240ea4f7a15 100644 (file)
@@ -461,22 +461,6 @@ static void ide_tape_kfree_buffer(idetape_tape_t *tape)
        }
 }
 
-static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects)
-{
-       struct request *rq = drive->hwif->rq;
-
-       debug_log(DBG_PROCS, "Enter %s\n", __func__);
-
-       rq->errors = uptodate ? 0 : IDE_DRV_ERROR_GENERAL;
-
-       if (uptodate == 0)
-               drive->failed_pc = NULL;
-
-       ide_complete_rq(drive, 0);
-
-       return 0;
-}
-
 static void ide_tape_handle_dsc(ide_drive_t *);
 
 static void ide_tape_callback(ide_drive_t *drive, int dsc)
@@ -2306,7 +2290,6 @@ static struct ide_driver idetape_driver = {
        .remove                 = ide_tape_remove,
        .version                = IDETAPE_VERSION,
        .do_request             = idetape_do_request,
-       .end_request            = idetape_end_request,
 #ifdef CONFIG_IDE_PROC_FS
        .proc_entries           = ide_tape_proc_entries,
        .proc_devsets           = ide_tape_proc_devsets,
index aece06a4930f3accc0dd72fc5bed29a87383b669..c2cdf77501853c8784d8f16e81b735c61a197f99 100644 (file)
@@ -427,7 +427,6 @@ struct ide_disk_ops {
                                        int);
        ide_startstop_t (*do_request)(struct ide_drive_s *, struct request *,
                                      sector_t);
-       int             (*end_request)(struct ide_drive_s *, int, int);
        int             (*ioctl)(struct ide_drive_s *, struct block_device *,
                                 fmode_t, unsigned int, unsigned long);
 };
@@ -1098,7 +1097,6 @@ void ide_check_pm_state(ide_drive_t *, struct request *);
 struct ide_driver {
        const char                      *version;
        ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t);
-       int             (*end_request)(ide_drive_t *, int, int);
        struct device_driver    gen_driver;
        int             (*probe)(ide_drive_t *);
        void            (*remove)(ide_drive_t *);