Merge branch 'vhost' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[safe/jmp/linux-2.6] / drivers / ide / tx4938ide.c
index e33d764..1d80f1f 100644 (file)
@@ -56,16 +56,15 @@ static void tx4938ide_tune_ebusc(unsigned int ebus_ch,
                     &tx4938_ebuscptr->cr[ebus_ch]);
 }
 
-static void tx4938ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
+static void tx4938ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
 {
-       ide_hwif_t *hwif = drive->hwif;
        struct tx4938ide_platform_info *pdata = hwif->dev->platform_data;
-       u8 safe = pio;
+       u8 safe = drive->pio_mode - XFER_PIO_0;
        ide_drive_t *pair;
 
        pair = ide_get_pair_dev(drive);
        if (pair)
-               safe = min(safe, ide_get_best_pio_mode(pair, 255, 5));
+               safe = min(safe, pair->pio_mode - XFER_PIO_0);
        tx4938ide_tune_ebusc(pdata->ebus_ch, pdata->gbus_clock, safe);
 }
 
@@ -130,8 +129,7 @@ static const struct ide_port_info tx4938ide_port_info __initdata = {
 
 static int __init tx4938ide_probe(struct platform_device *pdev)
 {
-       hw_regs_t hw;
-       hw_regs_t *hws[] = { &hw, NULL, NULL, NULL };
+       struct ide_hw hw, *hws[] = { &hw };
        struct ide_host *host;
        struct resource *res;
        struct tx4938ide_platform_info *pdata = pdev->dev.platform_data;
@@ -147,7 +145,7 @@ static int __init tx4938ide_probe(struct platform_device *pdev)
                return -ENODEV;
 
        if (!devm_request_mem_region(&pdev->dev, res->start,
-                                    res->end - res->start + 1, "tx4938ide"))
+                                    resource_size(res), "tx4938ide"))
                return -EBUSY;
        mapbase = (unsigned long)devm_ioremap(&pdev->dev, res->start,
                                              8 << pdata->ioport_shift);
@@ -183,7 +181,7 @@ static int __init tx4938ide_probe(struct platform_device *pdev)
                tx4938ide_tune_ebusc(pdata->ebus_ch, pdata->gbus_clock, 0);
        else
                d.port_ops = NULL;
-       ret = ide_host_add(&d, hws, &host);
+       ret = ide_host_add(&d, hws, 1, &host);
        if (!ret)
                platform_set_drvdata(pdev, host);
        return ret;