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 | 5df37c34a3acf29d1eb6fc675d078654da0ab395 (patch) | |
tree | 324d0614c57a823b3269aa61bc068b9a3b26ee4c | |
parent | 36501650ec45b1db308c3b51886044863be2d762 (diff) |
au1xxx-ide: use hwif->dev
* Setup hwif->dev in au_ide_probe().
* Use hwif->dev instead of ahwif->dev in auide_build_sglist(),
auide_build_dmatable(), auide_dma_end() and auide_ddma_init().
* Remove no longer needed 'dev' field from _auide_hwif type.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/mips/au1xxx-ide.c | 15 | ||||
-rw-r--r-- | include/asm-mips/mach-au1x00/au1xxx_ide.h | 1 |
2 files changed, 6 insertions, 10 deletions
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index 2d3e5115b834..7ec96a030041 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
@@ -213,7 +213,6 @@ static void auide_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
213 | static int auide_build_sglist(ide_drive_t *drive, struct request *rq) | 213 | static int auide_build_sglist(ide_drive_t *drive, struct request *rq) |
214 | { | 214 | { |
215 | ide_hwif_t *hwif = drive->hwif; | 215 | ide_hwif_t *hwif = drive->hwif; |
216 | _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; | ||
217 | struct scatterlist *sg = hwif->sg_table; | 216 | struct scatterlist *sg = hwif->sg_table; |
218 | 217 | ||
219 | ide_map_sg(drive, rq); | 218 | ide_map_sg(drive, rq); |
@@ -223,7 +222,7 @@ static int auide_build_sglist(ide_drive_t *drive, struct request *rq) | |||
223 | else | 222 | else |
224 | hwif->sg_dma_direction = DMA_TO_DEVICE; | 223 | hwif->sg_dma_direction = DMA_TO_DEVICE; |
225 | 224 | ||
226 | return dma_map_sg(ahwif->dev, sg, hwif->sg_nents, | 225 | return dma_map_sg(hwif->dev, sg, hwif->sg_nents, |
227 | hwif->sg_dma_direction); | 226 | hwif->sg_dma_direction); |
228 | } | 227 | } |
229 | 228 | ||
@@ -300,7 +299,7 @@ static int auide_build_dmatable(ide_drive_t *drive) | |||
300 | return 1; | 299 | return 1; |
301 | 300 | ||
302 | use_pio_instead: | 301 | use_pio_instead: |
303 | dma_unmap_sg(ahwif->dev, | 302 | dma_unmap_sg(hwif->dev, |
304 | hwif->sg_table, | 303 | hwif->sg_table, |
305 | hwif->sg_nents, | 304 | hwif->sg_nents, |
306 | hwif->sg_dma_direction); | 305 | hwif->sg_dma_direction); |
@@ -311,10 +310,9 @@ static int auide_build_dmatable(ide_drive_t *drive) | |||
311 | static int auide_dma_end(ide_drive_t *drive) | 310 | static int auide_dma_end(ide_drive_t *drive) |
312 | { | 311 | { |
313 | ide_hwif_t *hwif = HWIF(drive); | 312 | ide_hwif_t *hwif = HWIF(drive); |
314 | _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; | ||
315 | 313 | ||
316 | if (hwif->sg_nents) { | 314 | if (hwif->sg_nents) { |
317 | dma_unmap_sg(ahwif->dev, hwif->sg_table, hwif->sg_nents, | 315 | dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->sg_nents, |
318 | hwif->sg_dma_direction); | 316 | hwif->sg_dma_direction); |
319 | hwif->sg_nents = 0; | 317 | hwif->sg_nents = 0; |
320 | } | 318 | } |
@@ -504,7 +502,7 @@ static int auide_ddma_init(_auide_hwif *auide) { | |||
504 | auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan, | 502 | auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan, |
505 | NUM_DESCRIPTORS); | 503 | NUM_DESCRIPTORS); |
506 | 504 | ||
507 | hwif->dmatable_cpu = dma_alloc_coherent(auide->dev, | 505 | hwif->dmatable_cpu = dma_alloc_coherent(hwif->dev, |
508 | PRD_ENTRIES * PRD_BYTES, /* 1 Page */ | 506 | PRD_ENTRIES * PRD_BYTES, /* 1 Page */ |
509 | &hwif->dmatable_dma, GFP_KERNEL); | 507 | &hwif->dmatable_dma, GFP_KERNEL); |
510 | 508 | ||
@@ -592,9 +590,6 @@ static int au_ide_probe(struct device *dev) | |||
592 | #endif | 590 | #endif |
593 | 591 | ||
594 | memset(&auide_hwif, 0, sizeof(_auide_hwif)); | 592 | memset(&auide_hwif, 0, sizeof(_auide_hwif)); |
595 | auide_hwif.dev = 0; | ||
596 | |||
597 | ahwif->dev = dev; | ||
598 | ahwif->irq = platform_get_irq(pdev, 0); | 593 | ahwif->irq = platform_get_irq(pdev, 0); |
599 | 594 | ||
600 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 595 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -633,6 +628,8 @@ static int au_ide_probe(struct device *dev) | |||
633 | 628 | ||
634 | ide_init_port_hw(hwif, &hw); | 629 | ide_init_port_hw(hwif, &hw); |
635 | 630 | ||
631 | hwif->dev = dev; | ||
632 | |||
636 | hwif->ultra_mask = 0x0; /* Disable Ultra DMA */ | 633 | hwif->ultra_mask = 0x0; /* Disable Ultra DMA */ |
637 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | 634 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA |
638 | hwif->mwdma_mask = 0x07; /* Multimode-2 DMA */ | 635 | hwif->mwdma_mask = 0x07; /* Multimode-2 DMA */ |
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h index aef0edbfe4c6..e4fe26c160ba 100644 --- a/include/asm-mips/mach-au1x00/au1xxx_ide.h +++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h | |||
@@ -74,7 +74,6 @@ typedef struct | |||
74 | struct dbdma_cmd *dma_table_cpu; | 74 | struct dbdma_cmd *dma_table_cpu; |
75 | dma_addr_t dma_table_dma; | 75 | dma_addr_t dma_table_dma; |
76 | #endif | 76 | #endif |
77 | struct device *dev; | ||
78 | int irq; | 77 | int irq; |
79 | u32 regbase; | 78 | u32 regbase; |
80 | #ifdef CONFIG_PM | 79 | #ifdef CONFIG_PM |