ide: add ide_tune_dma() helper
After reworking the code responsible for selecting the best DMA transfer mode it is now possible to add generic ide_tune_dma() helper. Convert some IDE PCI host drivers to use it (the ones left need more work). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
@@ -118,25 +118,6 @@ static int jmicron_tune_chipset (ide_drive_t *drive, byte xferspeed)
|
||||
return ide_config_drive_speed(drive, speed);
|
||||
}
|
||||
|
||||
/**
|
||||
* config_chipset_for_dma - configure for DMA
|
||||
* @drive: drive to configure
|
||||
*
|
||||
* As the JMicron snoops for timings all we actually need to do is
|
||||
* make sure we don't set an invalid mode.
|
||||
*/
|
||||
|
||||
static int config_chipset_for_dma (ide_drive_t *drive)
|
||||
{
|
||||
u8 speed = ide_max_dma_mode(drive);
|
||||
|
||||
if (!speed)
|
||||
return 0;
|
||||
|
||||
jmicron_tune_chipset(drive, speed);
|
||||
return ide_dma_enable(drive);
|
||||
}
|
||||
|
||||
/**
|
||||
* jmicron_configure_drive_for_dma - set up for DMA transfers
|
||||
* @drive: drive we are going to set up
|
||||
@@ -147,7 +128,7 @@ static int config_chipset_for_dma (ide_drive_t *drive)
|
||||
|
||||
static int jmicron_config_drive_for_dma (ide_drive_t *drive)
|
||||
{
|
||||
if (ide_use_dma(drive) && config_chipset_for_dma(drive))
|
||||
if (ide_tune_dma(drive))
|
||||
return 0;
|
||||
|
||||
config_jmicron_chipset_for_pio(drive, 1);
|
||||
|
Reference in New Issue
Block a user