palm_bk3710: use ->init_dma method

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Saturday, April 26, 2008 - 5:59 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b552a2...
Commit:     b552a2c1dd01ab2380ea9429899591aa743f02e7
Parent:     04216fa1befbf8c737b7bf3bcc636009723f40d9
Author:     Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
AuthorDate: Sat Apr 26 22:25:23 2008 +0200
Committer:  Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
CommitDate: Sat Apr 26 22:25:23 2008 +0200

    palm_bk3710: use ->init_dma method
    
    * Move DMA setup to palm_bk3710_init_dma().
    
    * Convert the driver to use ->init_dma method.
    
    Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
    Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
    Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/arm/palm_bk3710.c |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index 7ed79e7..8fa34e2 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -317,6 +317,22 @@ static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
 	return ATA_CBL_PATA80;
 }
 
+static int __devinit palm_bk3710_init_dma(ide_hwif_t *hwif,
+					  const struct ide_port_info *d)
+{
+	unsigned long base =
+		hwif->io_ports[IDE_DATA_OFFSET] - IDE_PALM_ATA_PRI_REG_OFFSET;
+
+	printk(KERN_INFO "    %s: MMIO-DMA\n", hwif->name);
+
+	if (ide_allocate_dma_engine(hwif))
+		return -1;
+
+	ide_setup_dma(hwif, base);
+
+	return 0;
+}
+
 static const struct ide_port_ops palm_bk3710_ports_ops = {
 	.set_pio_mode		= palm_bk3710_set_pio_mode,
 	.set_dma_mode		= palm_bk3710_set_dma_mode,
@@ -324,8 +340,8 @@ static const struct ide_port_ops palm_bk3710_ports_ops = {
 };
 
 static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
+	.init_dma		= palm_bk3710_init_dma,
 	.port_ops		= &palm_bk3710_ports_ops,
-	.host_flags		= IDE_HFLAG_NO_DMA, /* hack (no PCI) */
 	.pio_mask		= ATA_PIO4,
 	.udma_mask		= ATA_UDMA4,	/* (input clk 99MHz) */
 	.mwdma_mask		= ATA_MWDMA2,
@@ -392,11 +408,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 	hwif->mmio = 1;
 	default_hwif_mmiops(hwif);
 
-	printk(KERN_INFO "    %s: MMIO-DMA\n", hwif->name);
-
-	if (ide_allocate_dma_engine(hwif) == 0)
-		ide_setup_dma(hwif, mem->start);
-
 	idx[0] = i;
 
 	ide_device_add(idx, &palm_bk3710_port_info);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
palm_bk3710: use ->init_dma method, Linux Kernel Mailing List..., (Sat Apr 26, 5:59 pm)