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

icside: use ec->dma directly

* hwif->hwif_data contains pointer to struct expansion_card so use ec->dma
directly instead of caching it in hwif->hw.dma.

* Remove no longer needed hw_regs_t.dma and NO_DMA define.

Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

+11 -21
+10 -10
drivers/ide/arm/icside.c
··· 316 316 317 317 drive->waiting_for_dma = 0; 318 318 319 - disable_dma(hwif->hw.dma); 319 + disable_dma(state->dev->dma); 320 320 321 321 /* Teardown mappings after DMA has completed. */ 322 322 dma_unmap_sg(state->dev, hwif->sg_table, hwif->sg_nents, 323 323 hwif->sg_dma_direction); 324 324 325 - return get_dma_residue(hwif->hw.dma) != 0; 325 + return get_dma_residue(state->dev->dma) != 0; 326 326 } 327 327 328 328 static void icside_dma_start(ide_drive_t *drive) 329 329 { 330 330 ide_hwif_t *hwif = HWIF(drive); 331 + struct icside_state *state = hwif->hwif_data; 331 332 332 333 /* We can not enable DMA on both channels simultaneously. */ 333 - BUG_ON(dma_channel_active(hwif->hw.dma)); 334 - enable_dma(hwif->hw.dma); 334 + BUG_ON(dma_channel_active(state->dev->dma)); 335 + enable_dma(state->dev->dma); 335 336 } 336 337 337 338 static int icside_dma_setup(ide_drive_t *drive) 338 339 { 339 340 ide_hwif_t *hwif = HWIF(drive); 341 + struct icside_state *state = hwif->hwif_data; 340 342 struct request *rq = hwif->hwgroup->rq; 341 343 unsigned int dma_mode; 342 344 ··· 350 348 /* 351 349 * We can not enable DMA on both channels. 352 350 */ 353 - BUG_ON(dma_channel_active(hwif->hw.dma)); 351 + BUG_ON(dma_channel_active(state->dev->dma)); 354 352 355 353 icside_build_sglist(drive, rq); 356 354 ··· 367 365 /* 368 366 * Select the correct timing for this drive. 369 367 */ 370 - set_dma_speed(hwif->hw.dma, drive->drive_data); 368 + set_dma_speed(state->dev->dma, drive->drive_data); 371 369 372 370 /* 373 371 * Tell the DMA engine about the SG table and 374 372 * data direction. 375 373 */ 376 - set_dma_sg(hwif->hw.dma, hwif->sg_table, hwif->sg_nents); 377 - set_dma_mode(hwif->hw.dma, dma_mode); 374 + set_dma_sg(state->dev->dma, hwif->sg_table, hwif->sg_nents); 375 + set_dma_mode(state->dev->dma, dma_mode); 378 376 379 377 drive->waiting_for_dma = 1; 380 378 ··· 574 572 hwif->serialized = 1; 575 573 hwif->config_data = (unsigned long)ioc_base; 576 574 hwif->select_data = sel; 577 - hwif->hw.dma = ec->dma; 578 575 579 576 mate->maskproc = icside_maskproc; 580 577 mate->channel = 1; ··· 582 581 mate->serialized = 1; 583 582 mate->config_data = (unsigned long)ioc_base; 584 583 mate->select_data = sel | 1; 585 - mate->hw.dma = ec->dma; 586 584 587 585 if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { 588 586 icside_dma_init(hwif);
-1
drivers/ide/h8300/ide-h8300.c
··· 68 68 hw->io_ports[i] = CONFIG_H8300_IDE_BASE + H8300_IDE_GAP*i; 69 69 hw->io_ports[IDE_CONTROL_OFFSET] = CONFIG_H8300_IDE_ALT; 70 70 hw->irq = EXT_IRQ0 + CONFIG_H8300_IDE_IRQ; 71 - hw->dma = NO_DMA; 72 71 hw->chipset = ide_generic; 73 72 } 74 73
-1
drivers/ide/ide-pnp.c
··· 40 40 ide_std_init_ports(&hw, pnp_port_start(dev, 0), 41 41 pnp_port_start(dev, 1)); 42 42 hw.irq = pnp_irq(dev, 0); 43 - hw.dma = NO_DMA; 44 43 45 44 index = ide_register_hw(&hw, NULL, 1, &hwif); 46 45
-1
drivers/ide/ide.c
··· 678 678 } 679 679 } 680 680 hw->irq = irq; 681 - hw->dma = NO_DMA; 682 681 hw->ack_intr = ack_intr; 683 682 /* 684 683 * hw->iops = iops;
-1
drivers/ide/legacy/ide_platform.c
··· 51 51 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports)); 52 52 hwif->hw.irq = hwif->irq = irq; 53 53 54 - hwif->hw.dma = NO_DMA; 55 54 hwif->chipset = hwif->hw.chipset = ide_generic; 56 55 57 56 if (mmio) {
+1 -2
drivers/ide/legacy/q40ide.c
··· 89 89 else 90 90 hw->io_ports[i] = Q40_ISA_IO_B(base + offsets[i]); 91 91 } 92 - 92 + 93 93 hw->irq = irq; 94 - hw->dma = NO_DMA; 95 94 hw->ack_intr = ack_intr; 96 95 /* 97 96 * hw->iops = iops;
-5
include/linux/ide.h
··· 192 192 struct hwif_s; 193 193 typedef int (ide_ack_intr_t)(struct hwif_s *); 194 194 195 - #ifndef NO_DMA 196 - #define NO_DMA 255 197 - #endif 198 - 199 195 /* 200 196 * hwif_chipset_t is used to keep track of the specific hardware 201 197 * chipset used by each IDE interface, if known. ··· 213 217 typedef struct hw_regs_s { 214 218 unsigned long io_ports[IDE_NR_PORTS]; /* task file registers */ 215 219 int irq; /* our irq number */ 216 - int dma; /* our dma entry */ 217 220 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ 218 221 hwif_chipset_t chipset; 219 222 struct device *dev;