From 5a8191fbe506cae8e640c1d96e2ad5c46ccca001 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Wed, 20 Oct 2004 02:06:01 +0200 Subject: [PATCH] [ide] convert ide_hwif_t->ide_dma_begin() to ->dma_start() Make ->ide_dma_begin() functions void and rename them to ->dma_start(). Signed-off-by: Bartlomiej Zolnierkiewicz --- arch/cris/arch-v10/drivers/ide.c | 7 +++---- drivers/ide/arm/icside.c | 5 ++--- drivers/ide/ide-cd.c | 3 ++- drivers/ide/ide-disk.c | 2 +- drivers/ide/ide-dma.c | 9 ++++----- drivers/ide/ide-floppy.c | 2 +- drivers/ide/ide-tape.c | 2 +- drivers/ide/ide-taskfile.c | 4 ++-- drivers/ide/ide.c | 2 +- drivers/ide/pci/hpt366.c | 8 ++++---- drivers/ide/pci/pdc202xx_old.c | 6 +++--- drivers/ide/pci/sgiioc4.c | 7 ++----- drivers/ide/pci/sl82c105.c | 8 +++----- drivers/ide/pci/trm290.c | 5 ++--- drivers/ide/ppc/pmac.c | 8 +++----- drivers/scsi/ide-scsi.c | 3 ++- include/linux/ide.h | 4 ++-- 17 files changed, 38 insertions(+), 47 deletions(-) diff --git a/arch/cris/arch-v10/drivers/ide.c b/arch/cris/arch-v10/drivers/ide.c index 155b3e679dab5..cd9c0fa9899f6 100644 --- a/arch/cris/arch-v10/drivers/ide.c +++ b/arch/cris/arch-v10/drivers/ide.c @@ -208,7 +208,7 @@ etrax100_ide_inb(ide_ioreg_t reg) #define ATA_PIO0_HOLD 4 static int e100_dma_check (ide_drive_t *drive); -static int e100_dma_begin (ide_drive_t *drive); +static void e100_dma_start(ide_drive_t *drive); static int e100_dma_end (ide_drive_t *drive); static void e100_ide_input_data (ide_drive_t *drive, void *, unsigned int); static void e100_ide_output_data (ide_drive_t *drive, void *, unsigned int); @@ -335,7 +335,7 @@ init_e100_ide (void) hwif->ide_dma_end = &e100_dma_end; hwif->dma_setup = &e100_dma_setup; hwif->dma_exec_cmd = &e100_dma_exec_cmd; - hwif->ide_dma_begin = &e100_dma_begin; + hwif->dma_start = &e100_dma_start; hwif->OUTB = &etrax100_ide_outb; hwif->OUTW = &etrax100_ide_outw; hwif->OUTBSYNC = &etrax100_ide_outbsync; @@ -815,7 +815,7 @@ static int e100_dma_end(ide_drive_t *drive) return 0; } -static int e100_dma_begin(ide_drive_t *drive) +static void e100_dma_start(ide_drive_t *drive) { if (e100_read_command) { /* begin DMA */ @@ -872,5 +872,4 @@ static int e100_dma_begin(ide_drive_t *drive) D(printk("dma write of %d bytes.\n", ata_tot_size)); } - return 0; } diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index 0abc096dfbf2a..330167da72905 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c @@ -400,14 +400,13 @@ static int icside_dma_end(ide_drive_t *drive) return get_dma_residue(hwif->hw.dma) != 0; } -static int icside_dma_begin(ide_drive_t *drive) +static void icside_dma_start(ide_drive_t *drive) { ide_hwif_t *hwif = HWIF(drive); /* We can not enable DMA on both channels simultaneously. */ BUG_ON(dma_channel_active(hwif->hw.dma)); enable_dma(hwif->hw.dma); - return 0; } /* @@ -559,7 +558,7 @@ static int icside_dma_init(ide_hwif_t *hwif) hwif->ide_dma_on = icside_dma_on; hwif->dma_setup = icside_dma_setup; hwif->dma_exec_cmd = icside_dma_exec_cmd; - hwif->ide_dma_begin = icside_dma_begin; + hwif->dma_start = icside_dma_start; hwif->ide_dma_end = icside_dma_end; hwif->ide_dma_test_irq = icside_dma_test_irq; hwif->ide_dma_verbose = icside_dma_verbose; diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 820178c1134d1..d639742019627 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -910,6 +910,7 @@ static ide_startstop_t cdrom_transfer_packet_command (ide_drive_t *drive, struct request *rq, ide_handler_t *handler) { + ide_hwif_t *hwif = drive->hwif; int cmd_len; struct cdrom_info *info = drive->driver_data; ide_startstop_t startstop; @@ -941,7 +942,7 @@ static ide_startstop_t cdrom_transfer_packet_command (ide_drive_t *drive, /* Start the DMA if need be */ if (info->dma) - (void) HWIF(drive)->ide_dma_begin(drive); + hwif->dma_start(drive); return ide_started; } diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index ebc4dbb07bcea..70e93aa031cb7 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -431,7 +431,7 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector command = lba48 ? WIN_READ_EXT: WIN_READ; } hwif->dma_exec_cmd(drive, command); - hwif->ide_dma_begin(drive); + hwif->dma_start(drive); return ide_started; } /* fallback to PIO */ diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index d2d4d3bf114cd..d041da5674e07 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -636,7 +636,7 @@ static void ide_dma_exec_cmd(ide_drive_t *drive, u8 command) ide_execute_command(drive, command, &ide_dma_intr, 2*WAIT_CMD, dma_timer_expiry); } -int __ide_dma_begin (ide_drive_t *drive) +void ide_dma_start(ide_drive_t *drive) { ide_hwif_t *hwif = HWIF(drive); u8 dma_cmd = hwif->INB(hwif->dma_command); @@ -650,10 +650,9 @@ int __ide_dma_begin (ide_drive_t *drive) hwif->OUTB(dma_cmd|1, hwif->dma_command); hwif->dma = 1; wmb(); - return 0; } -EXPORT_SYMBOL(__ide_dma_begin); +EXPORT_SYMBOL_GPL(ide_dma_start); /* returns 1 on error, 0 otherwise */ int __ide_dma_end (ide_drive_t *drive) @@ -955,8 +954,8 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p hwif->dma_setup = &ide_dma_setup; if (!hwif->dma_exec_cmd) hwif->dma_exec_cmd = &ide_dma_exec_cmd; - if (!hwif->ide_dma_begin) - hwif->ide_dma_begin = &__ide_dma_begin; + if (!hwif->dma_start) + hwif->dma_start = &ide_dma_start; if (!hwif->ide_dma_end) hwif->ide_dma_end = &__ide_dma_end; if (!hwif->ide_dma_test_irq) diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index ded2893cc8d20..99eef3064b046 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c @@ -1063,7 +1063,7 @@ static ide_startstop_t idefloppy_issue_pc (ide_drive_t *drive, idefloppy_pc_t *p if (feature.b.dma) { /* Begin DMA, if necessary */ set_bit(PC_DMA_IN_PROGRESS, &pc->flags); - (void) (HWIF(drive)->ide_dma_begin(drive)); + hwif->dma_start(drive); } /* Can we transfer the packet when we get the interrupt or wait? */ diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 8422980eade73..3ec7ff671c652 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c @@ -2067,7 +2067,7 @@ static ide_startstop_t idetape_transfer_pc(ide_drive_t *drive) #ifdef CONFIG_BLK_DEV_IDEDMA /* Begin DMA, if necessary */ if (test_bit(PC_DMA_IN_PROGRESS, &pc->flags)) - (void) (HWIF(drive)->ide_dma_begin(drive)); + hwif->dma_start(drive); #endif /* Send the actual packet */ HWIF(drive)->atapi_output_bytes(drive, pc->c, 12); diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 69547858dfab1..4a8019475c026 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -156,7 +156,7 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) case WIN_IDENTIFY_DMA: if (!hwif->dma_setup(drive)) { hwif->dma_exec_cmd(drive, taskfile->command); - hwif->ide_dma_begin(drive); + hwif->dma_start(drive); return ide_started; } break; @@ -903,7 +903,7 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task) case TASKFILE_IN_DMA: hwif->dma_setup(drive); hwif->dma_exec_cmd(drive, taskfile->command); - hwif->ide_dma_begin(drive); + hwif->dma_start(drive); break; default: diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 3ce862997c5b5..5f0a435272198 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -687,7 +687,7 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif) hwif->dma_setup = tmp_hwif->dma_setup; hwif->dma_exec_cmd = tmp_hwif->dma_exec_cmd; - hwif->ide_dma_begin = tmp_hwif->ide_dma_begin; + hwif->dma_start = tmp_hwif->dma_start; hwif->ide_dma_end = tmp_hwif->ide_dma_end; hwif->ide_dma_check = tmp_hwif->ide_dma_check; hwif->ide_dma_on = tmp_hwif->ide_dma_on; diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index d1e8adbe779de..5597ecf031ddd 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c @@ -577,7 +577,7 @@ static int hpt366_ide_dma_lostirq (ide_drive_t *drive) /* how about we flush and reset, mmmkay? */ pci_write_config_byte(dev, 0x51, 0x1F); /* fall through to a reset */ - case ide_dma_begin: + case dma_start: case ide_dma_end: /* reset the chips state over and over.. */ pci_write_config_byte(dev, 0x51, 0x13); @@ -592,12 +592,12 @@ static void hpt370_clear_engine (ide_drive_t *drive) udelay(10); } -static int hpt370_ide_dma_begin (ide_drive_t *drive) +static void hpt370_ide_dma_start(ide_drive_t *drive) { #ifdef HPT_RESET_STATE_ENGINE hpt370_clear_engine(drive); #endif - return __ide_dma_begin(drive); + ide_dma_start(drive); } static int hpt370_ide_dma_end (ide_drive_t *drive) @@ -1230,7 +1230,7 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) hwif->ide_dma_test_irq = &hpt374_ide_dma_test_irq; hwif->ide_dma_end = &hpt374_ide_dma_end; } else if (hpt_minimum_revision(dev,3)) { - hwif->ide_dma_begin = &hpt370_ide_dma_begin; + hwif->dma_start = &hpt370_ide_dma_start; hwif->ide_dma_end = &hpt370_ide_dma_end; hwif->ide_dma_timeout = &hpt370_ide_dma_timeout; hwif->ide_dma_lostirq = &hpt370_ide_dma_lostirq; diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index 651879a49832f..d139727318e2a 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c @@ -494,7 +494,7 @@ static int pdc202xx_quirkproc (ide_drive_t *drive) return ((int) check_in_drive_lists(drive, pdc_quirk_drives)); } -static int pdc202xx_old_ide_dma_begin(ide_drive_t *drive) +static void pdc202xx_old_ide_dma_start(ide_drive_t *drive) { if (drive->current_speed > XFER_UDMA_2) pdc_old_enable_66MHz_clock(drive->hwif); @@ -515,7 +515,7 @@ static int pdc202xx_old_ide_dma_begin(ide_drive_t *drive) word_count | 0x06000000; hwif->OUTL(word_count, atapi_reg); } - return __ide_dma_begin(drive); + ide_dma_start(drive); } static int pdc202xx_old_ide_dma_end(ide_drive_t *drive) @@ -736,7 +736,7 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif) if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) { if (!(hwif->udma_four)) hwif->udma_four = (pdc202xx_old_cable_detect(hwif)) ? 0 : 1; - hwif->ide_dma_begin = &pdc202xx_old_ide_dma_begin; + hwif->dma_start = &pdc202xx_old_ide_dma_start; hwif->ide_dma_end = &pdc202xx_old_ide_dma_end; } hwif->ide_dma_test_irq = &pdc202xx_old_ide_dma_test_irq; diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index e8c19d2c8cd96..ca2ef5404a5a5 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c @@ -192,16 +192,13 @@ sgiioc4_clearirq(ide_drive_t * drive) return intr_reg & 3; } -static int -sgiioc4_ide_dma_begin(ide_drive_t * drive) +static void sgiioc4_ide_dma_start(ide_drive_t * drive) { ide_hwif_t *hwif = HWIF(drive); unsigned int reg = hwif->INL(hwif->dma_base + IOC4_DMA_CTRL * 4); unsigned int temp_reg = reg | IOC4_S_DMA_START; hwif->OUTL(temp_reg, hwif->dma_base + IOC4_DMA_CTRL * 4); - - return 0; } static u32 @@ -625,7 +622,7 @@ ide_init_sgiioc4(ide_hwif_t * hwif) hwif->busproc = NULL; hwif->dma_setup = &sgiioc4_ide_dma_setup; - hwif->ide_dma_begin = &sgiioc4_ide_dma_begin; + hwif->dma_start = &sgiioc4_ide_dma_start; hwif->ide_dma_end = &sgiioc4_ide_dma_end; hwif->ide_dma_check = &sgiioc4_ide_dma_check; hwif->ide_dma_on = &sgiioc4_ide_dma_on; diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c index 563c44c7dae8d..d0cfec0559aa5 100644 --- a/drivers/ide/pci/sl82c105.c +++ b/drivers/ide/pci/sl82c105.c @@ -236,15 +236,13 @@ static int sl82c105_ide_dma_lost_irq(ide_drive_t *drive) * The generic IDE core will have disabled the BMEN bit before this * function is called. */ -static int sl82c105_ide_dma_begin(ide_drive_t *drive) +static void sl82c105_ide_dma_start(ide_drive_t *drive) { ide_hwif_t *hwif = HWIF(drive); struct pci_dev *dev = hwif->pci_dev; -// DBG(("sl82c105_ide_dma_begin(drive:%s)\n", drive->name)); - sl82c105_reset_host(dev); - return __ide_dma_begin(drive); + ide_dma_start(drive); } static int sl82c105_ide_dma_timeout(ide_drive_t *drive) @@ -469,7 +467,7 @@ static void __init init_hwif_sl82c105(ide_hwif_t *hwif) hwif->ide_dma_on = &sl82c105_ide_dma_on; hwif->ide_dma_off_quietly = &sl82c105_ide_dma_off_quietly; hwif->ide_dma_lostirq = &sl82c105_ide_dma_lost_irq; - hwif->ide_dma_begin = &sl82c105_ide_dma_begin; + hwif->dma_start = &sl82c105_ide_dma_start; hwif->ide_dma_timeout = &sl82c105_ide_dma_timeout; if (!noautodma) diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c index fa12ce293cd4d..17250160029e5 100644 --- a/drivers/ide/pci/trm290.c +++ b/drivers/ide/pci/trm290.c @@ -220,9 +220,8 @@ static int trm290_ide_dma_setup(ide_drive_t *drive) return 0; } -static int trm290_ide_dma_begin (ide_drive_t *drive) +static void trm290_ide_dma_start(ide_drive_t *drive) { - return 0; } static int trm290_ide_dma_end (ide_drive_t *drive) @@ -295,7 +294,7 @@ void __devinit init_hwif_trm290(ide_hwif_t *hwif) #ifdef CONFIG_BLK_DEV_IDEDMA hwif->dma_setup = &trm290_ide_dma_setup; hwif->dma_exec_cmd = &trm290_ide_dma_exec_cmd; - hwif->ide_dma_begin = &trm290_ide_dma_begin; + hwif->dma_start = &trm290_ide_dma_start; hwif->ide_dma_end = &trm290_ide_dma_end; hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq; #endif /* CONFIG_BLK_DEV_IDEDMA */ diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 0043bb35d2fb2..643bbc3a6267a 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -362,7 +362,6 @@ static int pmac_ide_tune_chipset(ide_drive_t *drive, u8 speed); static void pmac_ide_tuneproc(ide_drive_t *drive, u8 pio); static void pmac_ide_selectproc(ide_drive_t *drive); static void pmac_ide_kauai_selectproc(ide_drive_t *drive); -static int pmac_ide_dma_begin (ide_drive_t *drive); #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ @@ -1918,8 +1917,8 @@ pmac_ide_dma_exec_cmd(ide_drive_t *drive, u8 command) * Kick the DMA controller into life after the DMA command has been issued * to the drive. */ -static int __pmac -pmac_ide_dma_begin (ide_drive_t *drive) +static void __pmac +pmac_ide_dma_start(ide_drive_t *drive) { pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; volatile struct dbdma_regs __iomem *dma; @@ -1929,7 +1928,6 @@ pmac_ide_dma_begin (ide_drive_t *drive) writel((RUN << 16) | RUN, &dma->control); /* Make sure it gets to the controller right now */ (void)readl(&dma->control); - return 0; } /* @@ -2087,7 +2085,7 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif) hwif->ide_dma_check = &pmac_ide_dma_check; hwif->dma_setup = &pmac_ide_dma_setup; hwif->dma_exec_cmd = &pmac_ide_dma_exec_cmd; - hwif->ide_dma_begin = &pmac_ide_dma_begin; + hwif->dma_start = &pmac_ide_dma_start; hwif->ide_dma_end = &pmac_ide_dma_end; hwif->ide_dma_test_irq = &pmac_ide_dma_test_irq; hwif->ide_dma_host_off = &pmac_ide_dma_host_off; diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 166e0a6ab95a1..ea0527e9837e7 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c @@ -555,6 +555,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive) { + ide_hwif_t *hwif = drive->hwif; idescsi_scsi_t *scsi = drive_to_idescsi(drive); idescsi_pc_t *pc = scsi->pc; atapi_ireason_t ireason; @@ -579,7 +580,7 @@ static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive) atapi_output_bytes(drive, scsi->pc->c, 12); if (test_bit (PC_DMA_OK, &pc->flags)) { set_bit (PC_DMA_IN_PROGRESS, &pc->flags); - (void) (HWIF(drive)->ide_dma_begin(drive)); + hwif->dma_start(drive); } return ide_started; } diff --git a/include/linux/ide.h b/include/linux/ide.h index d1a78fe8a1edb..c05eb8673a4e6 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -889,7 +889,7 @@ typedef struct hwif_s { int (*dma_setup)(ide_drive_t *); void (*dma_exec_cmd)(ide_drive_t *, u8); - int (*ide_dma_begin)(ide_drive_t *drive); + void (*dma_start)(ide_drive_t *); int (*ide_dma_end)(ide_drive_t *drive); int (*ide_dma_check)(ide_drive_t *drive); int (*ide_dma_on)(ide_drive_t *drive); @@ -1551,7 +1551,7 @@ extern int __ide_dma_host_on(ide_drive_t *); extern int __ide_dma_on(ide_drive_t *); extern int __ide_dma_check(ide_drive_t *); extern int ide_dma_setup(ide_drive_t *); -extern int __ide_dma_begin(ide_drive_t *); +extern void ide_dma_start(ide_drive_t *); extern int __ide_dma_end(ide_drive_t *); extern int __ide_dma_test_irq(ide_drive_t *); extern int __ide_dma_verbose(ide_drive_t *); -- 2.53.0