Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+6 -10
+6 -9
drivers/ide/mips/au1xxx-ide.c
··· 213 213 static int auide_build_sglist(ide_drive_t *drive, struct request *rq) 214 214 { 215 215 ide_hwif_t *hwif = drive->hwif; 216 - _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; 217 216 struct scatterlist *sg = hwif->sg_table; 218 217 219 218 ide_map_sg(drive, rq); ··· 222 223 else 223 224 hwif->sg_dma_direction = DMA_TO_DEVICE; 224 225 225 - return dma_map_sg(ahwif->dev, sg, hwif->sg_nents, 226 + return dma_map_sg(hwif->dev, sg, hwif->sg_nents, 226 227 hwif->sg_dma_direction); 227 228 } 228 229 ··· 299 300 return 1; 300 301 301 302 use_pio_instead: 302 - dma_unmap_sg(ahwif->dev, 303 + dma_unmap_sg(hwif->dev, 303 304 hwif->sg_table, 304 305 hwif->sg_nents, 305 306 hwif->sg_dma_direction); ··· 310 311 static int auide_dma_end(ide_drive_t *drive) 311 312 { 312 313 ide_hwif_t *hwif = HWIF(drive); 313 - _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; 314 314 315 315 if (hwif->sg_nents) { 316 - dma_unmap_sg(ahwif->dev, hwif->sg_table, hwif->sg_nents, 316 + dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->sg_nents, 317 317 hwif->sg_dma_direction); 318 318 hwif->sg_nents = 0; 319 319 } ··· 502 504 auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan, 503 505 NUM_DESCRIPTORS); 504 506 505 - hwif->dmatable_cpu = dma_alloc_coherent(auide->dev, 507 + hwif->dmatable_cpu = dma_alloc_coherent(hwif->dev, 506 508 PRD_ENTRIES * PRD_BYTES, /* 1 Page */ 507 509 &hwif->dmatable_dma, GFP_KERNEL); 508 510 ··· 590 592 #endif 591 593 592 594 memset(&auide_hwif, 0, sizeof(_auide_hwif)); 593 - auide_hwif.dev = 0; 594 - 595 - ahwif->dev = dev; 596 595 ahwif->irq = platform_get_irq(pdev, 0); 597 596 598 597 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ··· 627 632 hw.chipset = ide_au1xxx; 628 633 629 634 ide_init_port_hw(hwif, &hw); 635 + 636 + hwif->dev = dev; 630 637 631 638 hwif->ultra_mask = 0x0; /* Disable Ultra DMA */ 632 639 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
-1
include/asm-mips/mach-au1x00/au1xxx_ide.h
··· 74 74 struct dbdma_cmd *dma_table_cpu; 75 75 dma_addr_t dma_table_dma; 76 76 #endif 77 - struct device *dev; 78 77 int irq; 79 78 u32 regbase; 80 79 #ifdef CONFIG_PM