aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:36 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:36 -0400
commit3ee38302ffc63da93eb0313053a990bb3466e275 (patch)
treeb8d66e808fd6d55972adc29ce072deaf2483af6c /drivers/ide
parent313afea7f25cc6d420179e0b316499c164e3e372 (diff)
ide: remove ->end_request method
* 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>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-cd.c1
-rw-r--r--drivers/ide/ide-disk.c1
-rw-r--r--drivers/ide/ide-floppy.c20
-rw-r--r--drivers/ide/ide-gd.c6
-rw-r--r--drivers/ide/ide-io.c14
-rw-r--r--drivers/ide/ide-tape.c17
6 files changed, 7 insertions, 52 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 4528e25f2bbb..bb804ae57bc5 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1834,7 +1834,6 @@ static struct ide_driver ide_cdrom_driver = {
1834 .remove = ide_cd_remove, 1834 .remove = ide_cd_remove,
1835 .version = IDECD_VERSION, 1835 .version = IDECD_VERSION,
1836 .do_request = ide_cd_do_request, 1836 .do_request = ide_cd_do_request,
1837 .end_request = ide_end_request,
1838#ifdef CONFIG_IDE_PROC_FS 1837#ifdef CONFIG_IDE_PROC_FS
1839 .proc_entries = ide_cd_proc_entries, 1838 .proc_entries = ide_cd_proc_entries,
1840 .proc_devsets = ide_cd_proc_devsets, 1839 .proc_devsets = ide_cd_proc_devsets,
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 0f196e5fcff3..912be155a8c1 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -734,6 +734,5 @@ const struct ide_disk_ops ide_ata_disk_ops = {
734 .init_media = ide_disk_init_media, 734 .init_media = ide_disk_init_media,
735 .set_doorlock = ide_disk_set_doorlock, 735 .set_doorlock = ide_disk_set_doorlock,
736 .do_request = ide_do_rw_disk, 736 .do_request = ide_do_rw_disk,
737 .end_request = ide_end_request,
738 .ioctl = ide_disk_ioctl, 737 .ioctl = ide_disk_ioctl,
739}; 738};
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index bdd8f8e2df6d..ab870a08d62b 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -61,25 +61,6 @@
61 */ 61 */
62#define IDEFLOPPY_PC_DELAY (HZ/20) /* default delay for ZIP 100 (50ms) */ 62#define IDEFLOPPY_PC_DELAY (HZ/20) /* default delay for ZIP 100 (50ms) */
63 63
64/*
65 * Used to finish servicing a private request.
66 */
67static int ide_floppy_end_request(ide_drive_t *drive, int uptodate, int nsecs)
68{
69 struct request *rq = drive->hwif->rq;
70
71 ide_debug_log(IDE_DBG_FUNC, "enter");
72
73 if (uptodate == 0)
74 drive->failed_pc = NULL;
75
76 rq->errors = uptodate ? 0 : IDE_DRV_ERROR_GENERAL;
77
78 ide_complete_rq(drive, 0);
79
80 return 0;
81}
82
83static void idefloppy_update_buffers(ide_drive_t *drive, 64static void idefloppy_update_buffers(ide_drive_t *drive,
84 struct ide_atapi_pc *pc) 65 struct ide_atapi_pc *pc)
85{ 66{
@@ -560,6 +541,5 @@ const struct ide_disk_ops ide_atapi_disk_ops = {
560 .init_media = ide_floppy_init_media, 541 .init_media = ide_floppy_init_media,
561 .set_doorlock = ide_set_media_lock, 542 .set_doorlock = ide_set_media_lock,
562 .do_request = ide_floppy_do_request, 543 .do_request = ide_floppy_do_request,
563 .end_request = ide_floppy_end_request,
564 .ioctl = ide_floppy_ioctl, 544 .ioctl = ide_floppy_ioctl,
565}; 545};
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c
index c51a35093ae2..1aebdf1a4f58 100644
--- a/drivers/ide/ide-gd.c
+++ b/drivers/ide/ide-gd.c
@@ -145,11 +145,6 @@ static ide_startstop_t ide_gd_do_request(ide_drive_t *drive,
145 return drive->disk_ops->do_request(drive, rq, sector); 145 return drive->disk_ops->do_request(drive, rq, sector);
146} 146}
147 147
148static int ide_gd_end_request(ide_drive_t *drive, int uptodate, int nrsecs)
149{
150 return drive->disk_ops->end_request(drive, uptodate, nrsecs);
151}
152
153static struct ide_driver ide_gd_driver = { 148static struct ide_driver ide_gd_driver = {
154 .gen_driver = { 149 .gen_driver = {
155 .owner = THIS_MODULE, 150 .owner = THIS_MODULE,
@@ -162,7 +157,6 @@ static struct ide_driver ide_gd_driver = {
162 .shutdown = ide_gd_shutdown, 157 .shutdown = ide_gd_shutdown,
163 .version = IDE_GD_VERSION, 158 .version = IDE_GD_VERSION,
164 .do_request = ide_gd_do_request, 159 .do_request = ide_gd_do_request,
165 .end_request = ide_gd_end_request,
166#ifdef CONFIG_IDE_PROC_FS 160#ifdef CONFIG_IDE_PROC_FS
167 .proc_entries = ide_disk_proc_entries, 161 .proc_entries = ide_disk_proc_entries,
168 .proc_devsets = ide_disk_proc_devsets, 162 .proc_devsets = ide_disk_proc_devsets,
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index da2f97dfa8f8..6eee41beec73 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -178,17 +178,17 @@ EXPORT_SYMBOL(ide_complete_rq);
178 178
179void ide_kill_rq(ide_drive_t *drive, struct request *rq) 179void ide_kill_rq(ide_drive_t *drive, struct request *rq)
180{ 180{
181 u8 drv_req = blk_special_request(rq) && rq->rq_disk;
182 u8 media = drive->media;
183
181 drive->failed_pc = NULL; 184 drive->failed_pc = NULL;
182 185
183 if (drive->media == ide_tape) 186 if ((media == ide_floppy && drv_req) || media == ide_tape)
184 rq->errors = IDE_DRV_ERROR_GENERAL; 187 rq->errors = IDE_DRV_ERROR_GENERAL;
185 188
186 if (blk_special_request(rq) && rq->rq_disk) { 189 if ((media == ide_floppy || media == ide_tape) && drv_req)
187 struct ide_driver *drv; 190 ide_complete_rq(drive, 0);
188 191 else
189 drv = *(struct ide_driver **)rq->rq_disk->private_data;
190 drv->end_request(drive, 0, 0);
191 } else
192 ide_end_request(drive, 0, 0); 192 ide_end_request(drive, 0, 0);
193} 193}
194 194
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 35469f3069a2..fc61bbef3bb9 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -461,22 +461,6 @@ static void ide_tape_kfree_buffer(idetape_tape_t *tape)
461 } 461 }
462} 462}
463 463
464static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects)
465{
466 struct request *rq = drive->hwif->rq;
467
468 debug_log(DBG_PROCS, "Enter %s\n", __func__);
469
470 rq->errors = uptodate ? 0 : IDE_DRV_ERROR_GENERAL;
471
472 if (uptodate == 0)
473 drive->failed_pc = NULL;
474
475 ide_complete_rq(drive, 0);
476
477 return 0;
478}
479
480static void ide_tape_handle_dsc(ide_drive_t *); 464static void ide_tape_handle_dsc(ide_drive_t *);
481 465
482static void ide_tape_callback(ide_drive_t *drive, int dsc) 466static void ide_tape_callback(ide_drive_t *drive, int dsc)
@@ -2306,7 +2290,6 @@ static struct ide_driver idetape_driver = {
2306 .remove = ide_tape_remove, 2290 .remove = ide_tape_remove,
2307 .version = IDETAPE_VERSION, 2291 .version = IDETAPE_VERSION,
2308 .do_request = idetape_do_request, 2292 .do_request = idetape_do_request,
2309 .end_request = idetape_end_request,
2310#ifdef CONFIG_IDE_PROC_FS 2293#ifdef CONFIG_IDE_PROC_FS
2311 .proc_entries = ide_tape_proc_entries, 2294 .proc_entries = ide_tape_proc_entries,
2312 .proc_devsets = ide_tape_proc_devsets, 2295 .proc_devsets = ide_tape_proc_devsets,