memset(&cmd, 0, sizeof(cmd));
cmd.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
- if (dma == 0) {
- ide_init_sg_cmd(&cmd, nsectors);
- ide_map_sg(drive, rq);
- }
-
if (drive->dev_flags & IDE_DFLAG_LBA) {
if (lba48) {
pr_debug("%s: LBA=0x%012llx\n", drive->name,
ide_tf_set_cmd(drive, &cmd, dma);
cmd.rq = rq;
+ if (dma == 0) {
+ ide_init_sg_cmd(&cmd, nsectors);
+ ide_map_sg(drive, &cmd);
+ }
+
rc = do_rw_taskfile(drive, &cmd);
if (rc == ide_stopped && dma) {