summaryrefslogtreecommitdiffstats
path: root/drivers/ide/mips
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 23:09:31 +0100
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 23:09:31 +0100
commit5df37c34a3acf29d1eb6fc675d078654da0ab395 (patch)
tree324d0614c57a823b3269aa61bc068b9a3b26ee4c /drivers/ide/mips
parent36501650ec45b1db308c3b51886044863be2d762 (diff)
downloadop-kernel-dev-5df37c34a3acf29d1eb6fc675d078654da0ab395.zip
op-kernel-dev-5df37c34a3acf29d1eb6fc675d078654da0ab395.tar.gz
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>
Diffstat (limited to 'drivers/ide/mips')
-rw-r--r--drivers/ide/mips/au1xxx-ide.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index 2d3e511..7ec96a0 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)
static int auide_build_sglist(ide_drive_t *drive, struct request *rq)
{
ide_hwif_t *hwif = drive->hwif;
- _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;
struct scatterlist *sg = hwif->sg_table;
ide_map_sg(drive, rq);
@@ -223,7 +222,7 @@ static int auide_build_sglist(ide_drive_t *drive, struct request *rq)
else
hwif->sg_dma_direction = DMA_TO_DEVICE;
- return dma_map_sg(ahwif->dev, sg, hwif->sg_nents,
+ return dma_map_sg(hwif->dev, sg, hwif->sg_nents,
hwif->sg_dma_direction);
}
@@ -300,7 +299,7 @@ static int auide_build_dmatable(ide_drive_t *drive)
return 1;
use_pio_instead:
- dma_unmap_sg(ahwif->dev,
+ dma_unmap_sg(hwif->dev,
hwif->sg_table,
hwif->sg_nents,
hwif->sg_dma_direction);
@@ -311,10 +310,9 @@ static int auide_build_dmatable(ide_drive_t *drive)
static int auide_dma_end(ide_drive_t *drive)
{
ide_hwif_t *hwif = HWIF(drive);
- _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;
if (hwif->sg_nents) {
- dma_unmap_sg(ahwif->dev, hwif->sg_table, hwif->sg_nents,
+ dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->sg_nents,
hwif->sg_dma_direction);
hwif->sg_nents = 0;
}
@@ -504,7 +502,7 @@ static int auide_ddma_init(_auide_hwif *auide) {
auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan,
NUM_DESCRIPTORS);
- hwif->dmatable_cpu = dma_alloc_coherent(auide->dev,
+ hwif->dmatable_cpu = dma_alloc_coherent(hwif->dev,
PRD_ENTRIES * PRD_BYTES, /* 1 Page */
&hwif->dmatable_dma, GFP_KERNEL);
@@ -592,9 +590,6 @@ static int au_ide_probe(struct device *dev)
#endif
memset(&auide_hwif, 0, sizeof(_auide_hwif));
- auide_hwif.dev = 0;
-
- ahwif->dev = dev;
ahwif->irq = platform_get_irq(pdev, 0);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -633,6 +628,8 @@ static int au_ide_probe(struct device *dev)
ide_init_port_hw(hwif, &hw);
+ hwif->dev = dev;
+
hwif->ultra_mask = 0x0; /* Disable Ultra DMA */
#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
hwif->mwdma_mask = 0x07; /* Multimode-2 DMA */
OpenPOWER on IntegriCloud