aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:46 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:46 -0400
commitb788ee9c6561fd9219a503216284d61036a0dc0b (patch)
treed83198a6c1a38661e60ac7454d1d82889c0472b3 /drivers/ide/ide-floppy.c
parent2298169418f43ba5e0919762a4bab95a1227872a (diff)
ide: use do_rw_taskfile() for ATA_CMD_PACKET commands
* Pass command to ide_issue_pc() and update ->do_request methods in ide-{cd,floppy,tape}.c accordingly. * Convert ide_pktcmd_tf_load() to ide_init_packet_cmd() which just initializes command structure and use do_rw_taskfile() to load ATA_CMD_PACKET commands. While at it: * Rename ide{floppy,tape}_issue_pc() to ide_{floppy,tape}_issue_pc(). 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.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index ee3e77a7a727..f3ed5de3141b 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -130,8 +130,9 @@ static void ide_floppy_report_error(struct ide_disk_obj *floppy,
130 130
131} 131}
132 132
133static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive, 133static ide_startstop_t ide_floppy_issue_pc(ide_drive_t *drive,
134 struct ide_atapi_pc *pc) 134 struct ide_cmd *cmd,
135 struct ide_atapi_pc *pc)
135{ 136{
136 struct ide_disk_obj *floppy = drive->driver_data; 137 struct ide_disk_obj *floppy = drive->driver_data;
137 138
@@ -157,7 +158,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive,
157 158
158 pc->retries++; 159 pc->retries++;
159 160
160 return ide_issue_pc(drive); 161 return ide_issue_pc(drive, cmd);
161} 162}
162 163
163void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *pc) 164void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *pc)
@@ -244,7 +245,7 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
244{ 245{
245 struct ide_disk_obj *floppy = drive->driver_data; 246 struct ide_disk_obj *floppy = drive->driver_data;
246 ide_hwif_t *hwif = drive->hwif; 247 ide_hwif_t *hwif = drive->hwif;
247 struct ide_cmd *cmd = &hwif->cmd; 248 struct ide_cmd cmd;
248 struct ide_atapi_pc *pc; 249 struct ide_atapi_pc *pc;
249 250
250 if (drive->debug_mask & IDE_DBG_RQ) 251 if (drive->debug_mask & IDE_DBG_RQ)
@@ -285,21 +286,24 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
285 goto out_end; 286 goto out_end;
286 } 287 }
287 288
289 memset(&cmd, 0, sizeof(cmd));
290
288 if (rq_data_dir(rq)) 291 if (rq_data_dir(rq))
289 cmd->tf_flags |= IDE_TFLAG_WRITE; 292 cmd.tf_flags |= IDE_TFLAG_WRITE;
290 cmd->rq = rq; 293
294 cmd.rq = rq;
291 295
292 if (blk_fs_request(rq) || pc->req_xfer) { 296 if (blk_fs_request(rq) || pc->req_xfer) {
293 ide_init_sg_cmd(cmd, rq->nr_sectors); 297 ide_init_sg_cmd(&cmd, rq->nr_sectors);
294 ide_map_sg(drive, cmd); 298 ide_map_sg(drive, &cmd);
295 } 299 }
296 300
297 pc->sg = hwif->sg_table; 301 pc->sg = hwif->sg_table;
298 pc->sg_cnt = cmd->sg_nents; 302 pc->sg_cnt = cmd.sg_nents;
299 303
300 pc->rq = rq; 304 pc->rq = rq;
301 305
302 return idefloppy_issue_pc(drive, pc); 306 return ide_floppy_issue_pc(drive, &cmd, pc);
303out_end: 307out_end:
304 drive->failed_pc = NULL; 308 drive->failed_pc = NULL;
305 if (blk_fs_request(rq) == 0 && rq->errors == 0) 309 if (blk_fs_request(rq) == 0 && rq->errors == 0)