]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/arm/palm_bk3710.c
IDE: palm_bk3710: fix compile warning for unused variable
[linux-2.6-omap-h63xx.git] / drivers / ide / arm / palm_bk3710.c
index c79b85b6e4a34e82b135cee906842656bc3652a9..581a7d1cc5005a3979267ea746608b2f089788c7 100644 (file)
@@ -82,6 +82,7 @@ static const struct palm_bk3710_udmatiming palm_bk3710_udmatimings[6] = {
        {100, 120},             /* UDMA Mode 2 */
        {100, 90},              /* UDMA Mode 3 */
        {100, 60},              /* UDMA Mode 4 */
+       {85,  40},              /* UDMA Mode 5 */
 };
 
 static void palm_bk3710_setudmamode(void __iomem *base, unsigned int dev,
@@ -308,7 +309,7 @@ static void __devinit palm_bk3710_chipinit(void __iomem *base)
        palm_bk3710_setpiomode(base, NULL, 1, 600, 0);
 }
 
-static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
+static u8 palm_bk3710_cable_detect(ide_hwif_t *hwif)
 {
        return ATA_CBL_PATA80;
 }
@@ -316,15 +317,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;
 }
@@ -335,12 +335,11 @@ static const struct ide_port_ops palm_bk3710_ports_ops = {
        .cable_detect           = palm_bk3710_cable_detect,
 };
 
-static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
+static 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_MMIO,
        .pio_mask               = ATA_PIO4,
-       .udma_mask              = ATA_UDMA4,    /* (input clk 99MHz) */
        .mwdma_mask             = ATA_MWDMA2,
 };
 
@@ -348,13 +347,11 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 {
        struct clk *clk;
        struct resource *mem, *irq;
-       ide_hwif_t *hwif;
        unsigned long base, rate;
-       int i;
-       hw_regs_t hw;
-       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+       int i, rc;
+       hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
 
-       clk = clk_get(NULL, "IDECLK");
+       clk = clk_get(&pdev->dev, "IDECLK");
        if (IS_ERR(clk))
                return -ENODEV;
 
@@ -394,24 +391,17 @@ 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)
-               goto out;
-
-       i = hwif->index;
+       palm_bk3710_port_info.udma_mask = rate < 100000000 ? ATA_UDMA4 :
+                                                            ATA_UDMA5;
 
-       ide_init_port_hw(hwif, &hw);
-
-       default_hwif_mmiops(hwif);
-
-       idx[0] = i;
-
-       ide_device_add(idx, &palm_bk3710_port_info);
+       rc = ide_host_add(&palm_bk3710_port_info, hws, NULL);
+       if (rc)
+               goto out;
 
        return 0;
 out:
        printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
-       return -ENODEV;
+       return rc;
 }
 
 /* work with hotplug and coldplug */