aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/arm/icside.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:32 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:32 -0400
commit86f3a492bb09eee5745b93af35f2212179c251fd (patch)
tree45d0f4725943fe0d0f16d44db3e643ce1f4d4553 /drivers/ide/arm/icside.c
parent8f173b5bf460a85791c131e774dc992f8cd578c1 (diff)
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>
Diffstat (limited to 'drivers/ide/arm/icside.c')
-rw-r--r--drivers/ide/arm/icside.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index fda3f870d7cd..22fc46d63448 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -316,27 +316,29 @@ static int icside_dma_end(ide_drive_t *drive)
316 316
317 drive->waiting_for_dma = 0; 317 drive->waiting_for_dma = 0;
318 318
319 disable_dma(hwif->hw.dma); 319 disable_dma(state->dev->dma);
320 320
321 /* Teardown mappings after DMA has completed. */ 321 /* Teardown mappings after DMA has completed. */
322 dma_unmap_sg(state->dev, hwif->sg_table, hwif->sg_nents, 322 dma_unmap_sg(state->dev, hwif->sg_table, hwif->sg_nents,
323 hwif->sg_dma_direction); 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
328static void icside_dma_start(ide_drive_t *drive) 328static void icside_dma_start(ide_drive_t *drive)
329{ 329{
330 ide_hwif_t *hwif = HWIF(drive); 330 ide_hwif_t *hwif = HWIF(drive);
331 struct icside_state *state = hwif->hwif_data;
331 332
332 /* We can not enable DMA on both channels simultaneously. */ 333 /* We can not enable DMA on both channels simultaneously. */
333 BUG_ON(dma_channel_active(hwif->hw.dma)); 334 BUG_ON(dma_channel_active(state->dev->dma));
334 enable_dma(hwif->hw.dma); 335 enable_dma(state->dev->dma);
335} 336}
336 337
337static int icside_dma_setup(ide_drive_t *drive) 338static int icside_dma_setup(ide_drive_t *drive)
338{ 339{
339 ide_hwif_t *hwif = HWIF(drive); 340 ide_hwif_t *hwif = HWIF(drive);
341 struct icside_state *state = hwif->hwif_data;
340 struct request *rq = hwif->hwgroup->rq; 342 struct request *rq = hwif->hwgroup->rq;
341 unsigned int dma_mode; 343 unsigned int dma_mode;
342 344
@@ -348,7 +350,7 @@ static int icside_dma_setup(ide_drive_t *drive)
348 /* 350 /*
349 * We can not enable DMA on both channels. 351 * We can not enable DMA on both channels.
350 */ 352 */
351 BUG_ON(dma_channel_active(hwif->hw.dma)); 353 BUG_ON(dma_channel_active(state->dev->dma));
352 354
353 icside_build_sglist(drive, rq); 355 icside_build_sglist(drive, rq);
354 356
@@ -365,14 +367,14 @@ static int icside_dma_setup(ide_drive_t *drive)
365 /* 367 /*
366 * Select the correct timing for this drive. 368 * Select the correct timing for this drive.
367 */ 369 */
368 set_dma_speed(hwif->hw.dma, drive->drive_data); 370 set_dma_speed(state->dev->dma, drive->drive_data);
369 371
370 /* 372 /*
371 * Tell the DMA engine about the SG table and 373 * Tell the DMA engine about the SG table and
372 * data direction. 374 * data direction.
373 */ 375 */
374 set_dma_sg(hwif->hw.dma, hwif->sg_table, hwif->sg_nents); 376 set_dma_sg(state->dev->dma, hwif->sg_table, hwif->sg_nents);
375 set_dma_mode(hwif->hw.dma, dma_mode); 377 set_dma_mode(state->dev->dma, dma_mode);
376 378
377 drive->waiting_for_dma = 1; 379 drive->waiting_for_dma = 1;
378 380
@@ -572,7 +574,6 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
572 hwif->serialized = 1; 574 hwif->serialized = 1;
573 hwif->config_data = (unsigned long)ioc_base; 575 hwif->config_data = (unsigned long)ioc_base;
574 hwif->select_data = sel; 576 hwif->select_data = sel;
575 hwif->hw.dma = ec->dma;
576 577
577 mate->maskproc = icside_maskproc; 578 mate->maskproc = icside_maskproc;
578 mate->channel = 1; 579 mate->channel = 1;
@@ -581,7 +582,6 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
581 mate->serialized = 1; 582 mate->serialized = 1;
582 mate->config_data = (unsigned long)ioc_base; 583 mate->config_data = (unsigned long)ioc_base;
583 mate->select_data = sel | 1; 584 mate->select_data = sel | 1;
584 mate->hw.dma = ec->dma;
585 585
586 if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { 586 if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) {
587 icside_dma_init(hwif); 587 icside_dma_init(hwif);