diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:23 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:23 -0400 |
commit | 91432f48094db32579776bd0a9d8432b16dc0a09 (patch) | |
tree | fe9767b5b7e0069db3447231a634954c04e4bb0c /drivers | |
parent | 0d07192297f664afdee36b330ab4fe52a8e38a6a (diff) |
icside: use ->init_dma method
* Add 'const struct ide_port_info *d' argument to icside_dma_init().
* Make icside_dma_init() return an error value and add icside_dma_off_init()
(->init_dma implementation for case when DMA cannot be enabled).
* Convert the driver to use ->init_dma method.
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/arm/icside.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index d7f4c533c45c..9118587a0db8 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c | |||
@@ -384,7 +384,7 @@ static void icside_dma_lost_irq(ide_drive_t *drive) | |||
384 | printk(KERN_ERR "%s: IRQ lost\n", drive->name); | 384 | printk(KERN_ERR "%s: IRQ lost\n", drive->name); |
385 | } | 385 | } |
386 | 386 | ||
387 | static void icside_dma_init(ide_hwif_t *hwif) | 387 | static int icside_dma_init(ide_hwif_t *hwif, const struct ide_port_info *d) |
388 | { | 388 | { |
389 | hwif->dmatable_cpu = NULL; | 389 | hwif->dmatable_cpu = NULL; |
390 | hwif->dmatable_dma = 0; | 390 | hwif->dmatable_dma = 0; |
@@ -397,11 +397,16 @@ static void icside_dma_init(ide_hwif_t *hwif) | |||
397 | hwif->ide_dma_test_irq = icside_dma_test_irq; | 397 | hwif->ide_dma_test_irq = icside_dma_test_irq; |
398 | hwif->dma_timeout = icside_dma_timeout; | 398 | hwif->dma_timeout = icside_dma_timeout; |
399 | hwif->dma_lost_irq = icside_dma_lost_irq; | 399 | hwif->dma_lost_irq = icside_dma_lost_irq; |
400 | |||
401 | return 0; | ||
400 | } | 402 | } |
401 | #else | ||
402 | #define icside_dma_init(hwif) (0) | ||
403 | #endif | 403 | #endif |
404 | 404 | ||
405 | static int icside_dma_off_init(ide_hwif_t *hwif, const struct ide_port_info *d) | ||
406 | { | ||
407 | return -EOPNOTSUPP; | ||
408 | } | ||
409 | |||
405 | static ide_hwif_t * | 410 | static ide_hwif_t * |
406 | icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *ec) | 411 | icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *ec) |
407 | { | 412 | { |
@@ -468,9 +473,9 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec) | |||
468 | } | 473 | } |
469 | 474 | ||
470 | static const struct ide_port_info icside_v6_port_info __initdata = { | 475 | static const struct ide_port_info icside_v6_port_info __initdata = { |
476 | .init_dma = icside_dma_off_init, | ||
471 | .port_ops = &icside_v6_no_dma_port_ops, | 477 | .port_ops = &icside_v6_no_dma_port_ops, |
472 | .host_flags = IDE_HFLAG_SERIALIZE | | 478 | .host_flags = IDE_HFLAG_SERIALIZE | |
473 | IDE_HFLAG_NO_DMA | /* no SFF-style DMA */ | ||
474 | IDE_HFLAG_NO_AUTOTUNE, | 479 | IDE_HFLAG_NO_AUTOTUNE, |
475 | .mwdma_mask = ATA_MWDMA2, | 480 | .mwdma_mask = ATA_MWDMA2, |
476 | .swdma_mask = ATA_SWDMA2, | 481 | .swdma_mask = ATA_SWDMA2, |
@@ -543,11 +548,9 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec) | |||
543 | mate->select_data = sel | 1; | 548 | mate->select_data = sel | 1; |
544 | 549 | ||
545 | if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { | 550 | if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { |
546 | icside_dma_init(hwif); | 551 | d.init_dma = icside_dma_init; |
547 | icside_dma_init(mate); | ||
548 | d.port_ops = &icside_v6_dma_port_ops; | 552 | d.port_ops = &icside_v6_dma_port_ops; |
549 | } else | 553 | } |
550 | d.mwdma_mask = d.swdma_mask = 0; | ||
551 | 554 | ||
552 | idx[0] = hwif->index; | 555 | idx[0] = hwif->index; |
553 | idx[1] = mate->index; | 556 | idx[1] = mate->index; |