aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:39 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:39 -0400
commit0c8a6c7aead1d3be85ce53e3aaacd52e38ede03e (patch)
tree2d43e9303f10c0f06b45bc97e661f0156aaf57da /drivers/ide/ide-floppy.c
parent0578042db3191e1ac76b53d213f2a691c3e1eaed (diff)
ide: add ide_do_start_stop() helper
* Add ide_do_start_stop() helper and convert ide-{floppy,tape}.c to use it. * Remove no longer used idefloppy_create_start_stop_cmd() and idetape_create_load_unload_cmd(). 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/ide-floppy.c')
-rw-r--r--drivers/ide/ide-floppy.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index f39cf404b030..b221a456e535 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -359,13 +359,6 @@ void ide_floppy_create_mode_sense_cmd(struct ide_atapi_pc *pc, u8 page_code)
359 pc->req_xfer = length; 359 pc->req_xfer = length;
360} 360}
361 361
362static void idefloppy_create_start_stop_cmd(struct ide_atapi_pc *pc, int start)
363{
364 ide_init_pc(pc);
365 pc->c[0] = GPCMD_START_STOP_UNIT;
366 pc->c[4] = start;
367}
368
369static void idefloppy_create_rw_cmd(idefloppy_floppy_t *floppy, 362static void idefloppy_create_rw_cmd(idefloppy_floppy_t *floppy,
370 struct ide_atapi_pc *pc, struct request *rq, 363 struct ide_atapi_pc *pc, struct request *rq,
371 unsigned long sector) 364 unsigned long sector)
@@ -800,10 +793,8 @@ static int idefloppy_open(struct inode *inode, struct file *filp)
800 ide_init_pc(&pc); 793 ide_init_pc(&pc);
801 pc.c[0] = GPCMD_TEST_UNIT_READY; 794 pc.c[0] = GPCMD_TEST_UNIT_READY;
802 795
803 if (ide_queue_pc_tail(drive, disk, &pc)) { 796 if (ide_queue_pc_tail(drive, disk, &pc))
804 idefloppy_create_start_stop_cmd(&pc, 1); 797 ide_do_start_stop(drive, disk, 1);
805 (void)ide_queue_pc_tail(drive, disk, &pc);
806 }
807 798
808 if (ide_floppy_get_capacity(drive) 799 if (ide_floppy_get_capacity(drive)
809 && (filp->f_flags & O_NDELAY) == 0 800 && (filp->f_flags & O_NDELAY) == 0
@@ -880,10 +871,8 @@ static int ide_floppy_lockdoor(ide_drive_t *drive, struct ide_atapi_pc *pc,
880 871
881 ide_set_media_lock(drive, disk, prevent); 872 ide_set_media_lock(drive, disk, prevent);
882 873
883 if (cmd == CDROMEJECT) { 874 if (cmd == CDROMEJECT)
884 idefloppy_create_start_stop_cmd(pc, 2); 875 ide_do_start_stop(drive, disk, 2);
885 (void)ide_queue_pc_tail(drive, disk, pc);
886 }
887 876
888 return 0; 877 return 0;
889} 878}