Commit 4a546e04 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: remove ->ide_dma_on and ->dma_off_quietly methods from ide_hwif_t



* Make ide_dma_off_quietly() and __ide_dma_on() always available.

* Drop "__" prefix from __ide_dma_on().

* Check for presence of ->dma_host_on instead of ->ide_dma_on.

* Convert all users of ->ide_dma_on and ->dma_off_quietly methods
  to use ide_dma_on() and ide_dma_off_quietly() instead.

* Remove no longer needed ->ide_dma_on and ->dma_off_quietly methods
  from ide_hwif_t.

* Make ide_dma_on() void.

There should be no functionality changes caused by this patch.

Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 378f577f
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -291,24 +291,10 @@ static void icside_dma_host_off(ide_drive_t *drive)
{
}

static void icside_dma_off_quietly(ide_drive_t *drive)
{
	drive->using_dma = 0;
	ide_toggle_bounce(drive, 0);
}

static void icside_dma_host_on(ide_drive_t *drive)
{
}

static int icside_dma_on(ide_drive_t *drive)
{
	drive->using_dma = 1;
	ide_toggle_bounce(drive, 1);

	return 0;
}

static int icside_dma_end(ide_drive_t *drive)
{
	ide_hwif_t *hwif = HWIF(drive);
@@ -425,9 +411,7 @@ static void icside_dma_init(ide_hwif_t *hwif)
	hwif->set_dma_mode	= icside_set_dma_mode;

	hwif->dma_host_off	= icside_dma_host_off;
	hwif->dma_off_quietly	= icside_dma_off_quietly;
	hwif->dma_host_on	= icside_dma_host_on;
	hwif->ide_dma_on	= icside_dma_on;
	hwif->dma_setup		= icside_dma_setup;
	hwif->dma_exec_cmd	= icside_dma_exec_cmd;
	hwif->dma_start		= icside_dma_start;
+12 −15
Original line number Diff line number Diff line
@@ -425,6 +425,7 @@ void ide_dma_host_off(ide_drive_t *drive)
}

EXPORT_SYMBOL(ide_dma_host_off);
#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */

/**
 *	ide_dma_off_quietly	-	Generic DMA kill
@@ -442,7 +443,6 @@ void ide_dma_off_quietly(ide_drive_t *drive)
}

EXPORT_SYMBOL(ide_dma_off_quietly);
#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */

/**
 *	ide_dma_off	-	disable DMA on a device
@@ -455,7 +455,7 @@ EXPORT_SYMBOL(ide_dma_off_quietly);
void ide_dma_off(ide_drive_t *drive)
{
	printk(KERN_INFO "%s: DMA disabled\n", drive->name);
	drive->hwif->dma_off_quietly(drive);
	ide_dma_off_quietly(drive);
}

EXPORT_SYMBOL(ide_dma_off);
@@ -481,26 +481,26 @@ void ide_dma_host_on(ide_drive_t *drive)
}

EXPORT_SYMBOL(ide_dma_host_on);
#endif

/**
 *	__ide_dma_on		-	Enable DMA on a device
 *	ide_dma_on		-	Enable DMA on a device
 *	@drive: drive to enable DMA on
 *
 *	Enable IDE DMA for a device on this IDE controller.
 */

int __ide_dma_on (ide_drive_t *drive)
void ide_dma_on(ide_drive_t *drive)
{
	drive->using_dma = 1;
	ide_toggle_bounce(drive, 1);

	drive->hwif->dma_host_on(drive);

	return 0;
}

EXPORT_SYMBOL(__ide_dma_on);
EXPORT_SYMBOL(ide_dma_on);

#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
/**
 *	ide_dma_setup	-	begin a DMA phase
 *	@drive: target device
@@ -827,7 +827,6 @@ err_out:

int ide_set_dma(ide_drive_t *drive)
{
	ide_hwif_t *hwif = drive->hwif;
	int rc;

	/*
@@ -836,13 +835,15 @@ int ide_set_dma(ide_drive_t *drive)
	 * things, if not checked and cleared.
	 *   PARANOIA!!!
	 */
	hwif->dma_off_quietly(drive);
	ide_dma_off_quietly(drive);

	rc = ide_dma_check(drive);
	if (rc)
		return rc;

	return hwif->ide_dma_on(drive);
	ide_dma_on(drive);

	return 0;
}

#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
@@ -979,12 +980,8 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base, unsigned num_ports)
	if (!(hwif->dma_prdtable))
		hwif->dma_prdtable	= (hwif->dma_base + 4);

	if (!hwif->dma_off_quietly)
		hwif->dma_off_quietly = &ide_dma_off_quietly;
	if (!hwif->dma_host_off)
		hwif->dma_host_off = &ide_dma_host_off;
	if (!hwif->ide_dma_on)
		hwif->ide_dma_on = &__ide_dma_on;
	if (!hwif->dma_host_on)
		hwif->dma_host_on = &ide_dma_host_on;
	if (!hwif->dma_setup)
+4 −4
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq,
	 */
	if (drive->state == DMA_PIO_RETRY && drive->retry_pio <= 3) {
		drive->state = 0;
		HWGROUP(drive)->hwif->ide_dma_on(drive);
		ide_dma_on(drive);
	}

	if (!end_that_request_chunk(rq, uptodate, nr_bytes)) {
@@ -219,7 +219,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
		 * we could be smarter and check for current xfer_speed
		 * in struct drive etc...
		 */
		if (drive->hwif->ide_dma_on == NULL)
		if (drive->hwif->dma_host_on == NULL)
			break;
		/*
		 * TODO: respect ->using_dma setting
@@ -787,7 +787,7 @@ static ide_startstop_t do_special (ide_drive_t *drive)

			if (hwif->host_flags & IDE_HFLAG_SET_PIO_MODE_KEEP_DMA) {
				if (keep_dma)
					hwif->ide_dma_on(drive);
					ide_dma_on(drive);
			}
		}

@@ -1334,7 +1334,7 @@ static ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error)
	 */
	drive->retry_pio++;
	drive->state = DMA_PIO_RETRY;
	hwif->dma_off_quietly(drive);
	ide_dma_off_quietly(drive);

	/*
	 * un-busy drive etc (hwgroup->busy is cleared on return) and
+5 −5
Original line number Diff line number Diff line
@@ -742,7 +742,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
//		msleep(50);

#ifdef CONFIG_BLK_DEV_IDEDMA
	if (hwif->ide_dma_on)	/* check if host supports DMA */
	if (hwif->dma_host_on)	/* check if host supports DMA */
		hwif->dma_host_off(drive);
#endif

@@ -801,8 +801,8 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
#ifdef CONFIG_BLK_DEV_IDEDMA
	if (speed >= XFER_SW_DMA_0 || (hwif->host_flags & IDE_HFLAG_VDMA))
		hwif->dma_host_on(drive);
	else if (hwif->ide_dma_on)	/* check if host supports DMA */
		hwif->dma_off_quietly(drive);
	else if (hwif->dma_host_on)	/* check if host supports DMA */
		ide_dma_off_quietly(drive);
#endif

	switch(speed) {
@@ -1012,10 +1012,10 @@ static void check_dma_crc(ide_drive_t *drive)
{
#ifdef CONFIG_BLK_DEV_IDEDMA
	if (drive->crc_count) {
		drive->hwif->dma_off_quietly(drive);
		ide_dma_off_quietly(drive);
		ide_set_xfer_rate(drive, ide_auto_reduce_xfer(drive));
		if (drive->current_speed >= XFER_SW_DMA_0)
			(void) HWIF(drive)->ide_dma_on(drive);
			ide_dma_on(drive);
	} else
		ide_dma_off(drive);
#endif
+1 −1
Original line number Diff line number Diff line
@@ -833,7 +833,7 @@ static void probe_hwif(ide_hwif_t *hwif)

			drive->nice1 = 1;

			if (hwif->ide_dma_on)
			if (hwif->dma_host_on)
				ide_set_dma(drive);
		}
	}
Loading