]> err.no Git - linux-2.6/blobdiff - drivers/ide/arm/palm_bk3710.c
ide: add struct ide_host (take 3)
[linux-2.6] / drivers / ide / arm / palm_bk3710.c
index 3839f5722985128bcce2ded6ef7ba1dd15597560..24389a571c37bfcc4ecd03b0c858a1429a975f91 100644 (file)
@@ -74,8 +74,6 @@ struct palm_bk3710_udmatiming {
 #define BK3710_IORDYTMP                0x78
 #define BK3710_IORDYTMS                0x7C
 
-#include "../ide-timing.h"
-
 static unsigned ideclk_period; /* in nanoseconds */
 
 static const struct palm_bk3710_udmatiming palm_bk3710_udmatimings[6] = {
@@ -318,15 +316,14 @@ static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
 static int __devinit palm_bk3710_init_dma(ide_hwif_t *hwif,
                                          const struct ide_port_info *d)
 {
-       unsigned long base =
-               hwif->io_ports.data_addr - 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);
+       hwif->dma_base = hwif->io_ports.data_addr - IDE_PALM_ATA_PRI_REG_OFFSET;
+
+       hwif->dma_ops = &sff_dma_ops;
 
        return 0;
 }
@@ -350,11 +347,10 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 {
        struct clk *clk;
        struct resource *mem, *irq;
-       ide_hwif_t *hwif;
+       struct ide_host *host;
        unsigned long base, rate;
        int i;
-       hw_regs_t hw;
-       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+       hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
 
        clk = clk_get(NULL, "IDECLK");
        if (IS_ERR(clk))
@@ -396,20 +392,11 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
        hw.irq = irq->start;
        hw.chipset = ide_palm3710;
 
-       hwif = ide_find_port();
-       if (hwif == NULL)
+       host = ide_host_alloc(&palm_bk3710_port_info, hws);
+       if (host == NULL)
                goto out;
 
-       i = hwif->index;
-
-       ide_init_port_data(hwif, i);
-       ide_init_port_hw(hwif, &hw);
-
-       default_hwif_mmiops(hwif);
-
-       idx[0] = i;
-
-       ide_device_add(idx, &palm_bk3710_port_info);
+       ide_host_register(host, &palm_bk3710_port_info, hws);
 
        return 0;
 out: