diff options
Diffstat (limited to 'drivers/ide/mips/au1xxx-ide.c')
-rw-r--r-- | drivers/ide/mips/au1xxx-ide.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index ca95e990862..2e7013a2a7f 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
@@ -381,9 +381,7 @@ static int auide_dma_setup(ide_drive_t *drive) | |||
381 | 381 | ||
382 | static int auide_dma_check(ide_drive_t *drive) | 382 | static int auide_dma_check(ide_drive_t *drive) |
383 | { | 383 | { |
384 | u8 speed; | 384 | u8 speed = ide_max_dma_mode(drive); |
385 | |||
386 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
387 | 385 | ||
388 | if( dbdma_init_done == 0 ){ | 386 | if( dbdma_init_done == 0 ){ |
389 | auide_hwif.white_list = ide_in_drive_list(drive->id, | 387 | auide_hwif.white_list = ide_in_drive_list(drive->id, |
@@ -394,7 +392,6 @@ static int auide_dma_check(ide_drive_t *drive) | |||
394 | auide_ddma_init(&auide_hwif); | 392 | auide_ddma_init(&auide_hwif); |
395 | dbdma_init_done = 1; | 393 | dbdma_init_done = 1; |
396 | } | 394 | } |
397 | #endif | ||
398 | 395 | ||
399 | /* Is the drive in our DMA black list? */ | 396 | /* Is the drive in our DMA black list? */ |
400 | 397 | ||
@@ -409,8 +406,6 @@ static int auide_dma_check(ide_drive_t *drive) | |||
409 | else | 406 | else |
410 | drive->using_dma = 1; | 407 | drive->using_dma = 1; |
411 | 408 | ||
412 | speed = ide_find_best_mode(drive, XFER_PIO | XFER_MWDMA); | ||
413 | |||
414 | if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) | 409 | if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) |
415 | return 0; | 410 | return 0; |
416 | 411 | ||
@@ -456,10 +451,9 @@ static void auide_dma_off_quietly(ide_drive_t *drive) | |||
456 | drive->using_dma = 0; | 451 | drive->using_dma = 0; |
457 | } | 452 | } |
458 | 453 | ||
459 | static int auide_dma_lostirq(ide_drive_t *drive) | 454 | static void auide_dma_lost_irq(ide_drive_t *drive) |
460 | { | 455 | { |
461 | printk(KERN_ERR "%s: IRQ lost\n", drive->name); | 456 | printk(KERN_ERR "%s: IRQ lost\n", drive->name); |
462 | return 0; | ||
463 | } | 457 | } |
464 | 458 | ||
465 | static void auide_ddma_tx_callback(int irq, void *param) | 459 | static void auide_ddma_tx_callback(int irq, void *param) |
@@ -489,16 +483,16 @@ static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 de | |||
489 | 483 | ||
490 | #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) | 484 | #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) |
491 | 485 | ||
492 | static int auide_dma_timeout(ide_drive_t *drive) | 486 | static void auide_dma_timeout(ide_drive_t *drive) |
493 | { | 487 | { |
494 | // printk("%s\n", __FUNCTION__); | 488 | ide_hwif_t *hwif = HWIF(drive); |
495 | 489 | ||
496 | printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); | 490 | printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); |
497 | 491 | ||
498 | if (HWIF(drive)->ide_dma_test_irq(drive)) | 492 | if (hwif->ide_dma_test_irq(drive)) |
499 | return 0; | 493 | return; |
500 | 494 | ||
501 | return HWIF(drive)->ide_dma_end(drive); | 495 | hwif->ide_dma_end(drive); |
502 | } | 496 | } |
503 | 497 | ||
504 | 498 | ||
@@ -721,7 +715,7 @@ static int au_ide_probe(struct device *dev) | |||
721 | 715 | ||
722 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | 716 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA |
723 | hwif->dma_off_quietly = &auide_dma_off_quietly; | 717 | hwif->dma_off_quietly = &auide_dma_off_quietly; |
724 | hwif->ide_dma_timeout = &auide_dma_timeout; | 718 | hwif->dma_timeout = &auide_dma_timeout; |
725 | 719 | ||
726 | hwif->ide_dma_check = &auide_dma_check; | 720 | hwif->ide_dma_check = &auide_dma_check; |
727 | hwif->dma_exec_cmd = &auide_dma_exec_cmd; | 721 | hwif->dma_exec_cmd = &auide_dma_exec_cmd; |
@@ -731,7 +725,7 @@ static int au_ide_probe(struct device *dev) | |||
731 | hwif->ide_dma_test_irq = &auide_dma_test_irq; | 725 | hwif->ide_dma_test_irq = &auide_dma_test_irq; |
732 | hwif->dma_host_off = &auide_dma_host_off; | 726 | hwif->dma_host_off = &auide_dma_host_off; |
733 | hwif->dma_host_on = &auide_dma_host_on; | 727 | hwif->dma_host_on = &auide_dma_host_on; |
734 | hwif->ide_dma_lostirq = &auide_dma_lostirq; | 728 | hwif->dma_lost_irq = &auide_dma_lost_irq; |
735 | hwif->ide_dma_on = &auide_dma_on; | 729 | hwif->ide_dma_on = &auide_dma_on; |
736 | 730 | ||
737 | hwif->autodma = 1; | 731 | hwif->autodma = 1; |