diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:31 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:31 -0500 |
commit | 36501650ec45b1db308c3b51886044863be2d762 (patch) | |
tree | 74cf9d9f313e510f8424f9bac35da8d61cce9f7b /drivers/ide/ide-dma.c | |
parent | f6fb786d6dcdd7d730e4fba620b071796f487e1b (diff) |
ide: keep pointer to struct device instead of struct pci_dev in ide_hwif_t
Keep pointer to struct device instead of struct pci_dev in ide_hwif_t.
While on it:
* Use *dev->dma_mask instead of pci_dev->dma_mask in ide_toggle_bounce().
There should be no functionality 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 | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 1ca1210ec1c0..782e5da01578 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -184,6 +184,7 @@ static int ide_dma_good_drive(ide_drive_t *drive) | |||
184 | int ide_build_sglist(ide_drive_t *drive, struct request *rq) | 184 | int ide_build_sglist(ide_drive_t *drive, struct request *rq) |
185 | { | 185 | { |
186 | ide_hwif_t *hwif = HWIF(drive); | 186 | ide_hwif_t *hwif = HWIF(drive); |
187 | struct pci_dev *pdev = to_pci_dev(hwif->dev); | ||
187 | struct scatterlist *sg = hwif->sg_table; | 188 | struct scatterlist *sg = hwif->sg_table; |
188 | 189 | ||
189 | ide_map_sg(drive, rq); | 190 | ide_map_sg(drive, rq); |
@@ -193,7 +194,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq) | |||
193 | else | 194 | else |
194 | hwif->sg_dma_direction = PCI_DMA_TODEVICE; | 195 | hwif->sg_dma_direction = PCI_DMA_TODEVICE; |
195 | 196 | ||
196 | return pci_map_sg(hwif->pci_dev, sg, hwif->sg_nents, hwif->sg_dma_direction); | 197 | return pci_map_sg(pdev, sg, hwif->sg_nents, hwif->sg_dma_direction); |
197 | } | 198 | } |
198 | 199 | ||
199 | EXPORT_SYMBOL_GPL(ide_build_sglist); | 200 | EXPORT_SYMBOL_GPL(ide_build_sglist); |
@@ -306,11 +307,11 @@ EXPORT_SYMBOL_GPL(ide_build_dmatable); | |||
306 | 307 | ||
307 | void ide_destroy_dmatable (ide_drive_t *drive) | 308 | void ide_destroy_dmatable (ide_drive_t *drive) |
308 | { | 309 | { |
309 | struct pci_dev *dev = HWIF(drive)->pci_dev; | 310 | ide_hwif_t *hwif = drive->hwif; |
310 | struct scatterlist *sg = HWIF(drive)->sg_table; | 311 | struct pci_dev *pdev = to_pci_dev(hwif->dev); |
311 | int nents = HWIF(drive)->sg_nents; | ||
312 | 312 | ||
313 | pci_unmap_sg(dev, sg, nents, HWIF(drive)->sg_dma_direction); | 313 | pci_unmap_sg(pdev, hwif->sg_table, hwif->sg_nents, |
314 | hwif->sg_dma_direction); | ||
314 | } | 315 | } |
315 | 316 | ||
316 | EXPORT_SYMBOL_GPL(ide_destroy_dmatable); | 317 | EXPORT_SYMBOL_GPL(ide_destroy_dmatable); |
@@ -843,10 +844,10 @@ EXPORT_SYMBOL(ide_dma_timeout); | |||
843 | static void ide_release_dma_engine(ide_hwif_t *hwif) | 844 | static void ide_release_dma_engine(ide_hwif_t *hwif) |
844 | { | 845 | { |
845 | if (hwif->dmatable_cpu) { | 846 | if (hwif->dmatable_cpu) { |
846 | pci_free_consistent(hwif->pci_dev, | 847 | struct pci_dev *pdev = to_pci_dev(hwif->dev); |
847 | PRD_ENTRIES * PRD_BYTES, | 848 | |
848 | hwif->dmatable_cpu, | 849 | pci_free_consistent(pdev, PRD_ENTRIES * PRD_BYTES, |
849 | hwif->dmatable_dma); | 850 | hwif->dmatable_cpu, hwif->dmatable_dma); |
850 | hwif->dmatable_cpu = NULL; | 851 | hwif->dmatable_cpu = NULL; |
851 | } | 852 | } |
852 | } | 853 | } |
@@ -874,7 +875,9 @@ int ide_release_dma(ide_hwif_t *hwif) | |||
874 | 875 | ||
875 | static int ide_allocate_dma_engine(ide_hwif_t *hwif) | 876 | static int ide_allocate_dma_engine(ide_hwif_t *hwif) |
876 | { | 877 | { |
877 | hwif->dmatable_cpu = pci_alloc_consistent(hwif->pci_dev, | 878 | struct pci_dev *pdev = to_pci_dev(hwif->dev); |
879 | |||
880 | hwif->dmatable_cpu = pci_alloc_consistent(pdev, | ||
878 | PRD_ENTRIES * PRD_BYTES, | 881 | PRD_ENTRIES * PRD_BYTES, |
879 | &hwif->dmatable_dma); | 882 | &hwif->dmatable_dma); |
880 | 883 | ||