]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/ide/legacy/ide_platform.c
ide_platform: use struct ide_port_info
[karo-tx-linux.git] / drivers / ide / legacy / ide_platform.c
index 688fcae17488d85505d6a44cd6a2c36fa87e0c9a..a249562b34b52b1ddfb8401136dd5b9c062fd0f6 100644 (file)
@@ -30,20 +30,24 @@ static void __devinit plat_ide_setup_ports(hw_regs_t *hw,
        unsigned long port = (unsigned long)base;
        int i;
 
-       hw->io_ports[IDE_DATA_OFFSET] = port;
+       hw->io_ports.data_addr = port;
 
        port += (1 << pdata->ioport_shift);
-       for (i = IDE_ERROR_OFFSET; i <= IDE_STATUS_OFFSET;
+       for (i = 1; i <= 7;
             i++, port += (1 << pdata->ioport_shift))
-               hw->io_ports[i] = port;
+               hw->io_ports_array[i] = port;
 
-       hw->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
+       hw->io_ports.ctl_addr = (unsigned long)ctrl;
 
        hw->irq = irq;
 
        hw->chipset = ide_generic;
 }
 
+static const struct ide_port_info platform_ide_port_info = {
+       .host_flags             = IDE_HFLAG_NO_DMA,
+};
+
 static int __devinit plat_ide_probe(struct platform_device *pdev)
 {
        struct resource *res_base, *res_alt, *res_irq;
@@ -54,6 +58,7 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
        int ret = 0;
        int mmio = 0;
        hw_regs_t hw;
+       struct ide_port_info d = platform_ide_port_info;
 
        pdata = pdev->dev.platform_data;
 
@@ -89,7 +94,7 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
                        res_alt->start, res_alt->end - res_alt->start + 1);
        }
 
-       hwif = ide_find_port((unsigned long)base);
+       hwif = ide_find_port();
        if (!hwif) {
                ret = -ENODEV;
                goto out;
@@ -102,13 +107,13 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
        ide_init_port_hw(hwif, &hw);
 
        if (mmio) {
-               hwif->mmio = 1;
+               d.host_flags |= IDE_HFLAG_MMIO;
                default_hwif_mmiops(hwif);
        }
 
        idx[0] = hwif->index;
 
-       ide_device_add(idx, NULL);
+       ide_device_add(idx, &d);
 
        platform_set_drvdata(pdev, hwif);
 
@@ -122,7 +127,7 @@ static int __devexit plat_ide_remove(struct platform_device *pdev)
 {
        ide_hwif_t *hwif = pdev->dev.driver_data;
 
-       ide_unregister(hwif->index, 0, 0);
+       ide_unregister(hwif);
 
        return 0;
 }
@@ -130,6 +135,7 @@ static int __devexit plat_ide_remove(struct platform_device *pdev)
 static struct platform_driver platform_ide_driver = {
        .driver = {
                .name = "pata_platform",
+               .owner = THIS_MODULE,
        },
        .probe = plat_ide_probe,
        .remove = __devexit_p(plat_ide_remove),
@@ -147,6 +153,7 @@ static void __exit platform_ide_exit(void)
 
 MODULE_DESCRIPTION("Platform IDE driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:pata_platform");
 
 module_init(platform_ide_init);
 module_exit(platform_ide_exit);