diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:38 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:38 -0400 |
commit | b6308ee0c55acd2e943d849773c9f0a49c516317 (patch) | |
tree | e56f59a7935fccdf0145ffd4638a066bf4ba1e17 /drivers/ide/ide-dma.c | |
parent | adb1af9803d167091c2cb4de14014185054bfe2c (diff) |
ide: move command related fields from ide_hwif_t to struct ide_cmd
* Move command related fields from ide_hwif_t to struct ide_cmd.
* Make ide_init_sg_cmd() take command and sectors number as arguments.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r-- | drivers/ide/ide-dma.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 54f17ae9225d..cba9fe585d87 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -128,21 +128,22 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq) | |||
128 | { | 128 | { |
129 | ide_hwif_t *hwif = drive->hwif; | 129 | ide_hwif_t *hwif = drive->hwif; |
130 | struct scatterlist *sg = hwif->sg_table; | 130 | struct scatterlist *sg = hwif->sg_table; |
131 | struct ide_cmd *cmd = &hwif->cmd; | ||
131 | int i; | 132 | int i; |
132 | 133 | ||
133 | ide_map_sg(drive, rq); | 134 | ide_map_sg(drive, rq); |
134 | 135 | ||
135 | if (rq_data_dir(rq) == READ) | 136 | if (rq_data_dir(rq) == READ) |
136 | hwif->sg_dma_direction = DMA_FROM_DEVICE; | 137 | cmd->sg_dma_direction = DMA_FROM_DEVICE; |
137 | else | 138 | else |
138 | hwif->sg_dma_direction = DMA_TO_DEVICE; | 139 | cmd->sg_dma_direction = DMA_TO_DEVICE; |
139 | 140 | ||
140 | i = dma_map_sg(hwif->dev, sg, hwif->sg_nents, hwif->sg_dma_direction); | 141 | i = dma_map_sg(hwif->dev, sg, cmd->sg_nents, cmd->sg_dma_direction); |
141 | if (i == 0) | 142 | if (i == 0) |
142 | ide_map_sg(drive, rq); | 143 | ide_map_sg(drive, rq); |
143 | else { | 144 | else { |
144 | hwif->orig_sg_nents = hwif->sg_nents; | 145 | cmd->orig_sg_nents = cmd->sg_nents; |
145 | hwif->sg_nents = i; | 146 | cmd->sg_nents = i; |
146 | } | 147 | } |
147 | 148 | ||
148 | return i; | 149 | return i; |
@@ -162,9 +163,10 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq) | |||
162 | void ide_destroy_dmatable(ide_drive_t *drive) | 163 | void ide_destroy_dmatable(ide_drive_t *drive) |
163 | { | 164 | { |
164 | ide_hwif_t *hwif = drive->hwif; | 165 | ide_hwif_t *hwif = drive->hwif; |
166 | struct ide_cmd *cmd = &hwif->cmd; | ||
165 | 167 | ||
166 | dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->orig_sg_nents, | 168 | dma_unmap_sg(hwif->dev, hwif->sg_table, cmd->orig_sg_nents, |
167 | hwif->sg_dma_direction); | 169 | cmd->sg_dma_direction); |
168 | } | 170 | } |
169 | EXPORT_SYMBOL_GPL(ide_destroy_dmatable); | 171 | EXPORT_SYMBOL_GPL(ide_destroy_dmatable); |
170 | 172 | ||