Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[safe/jmp/linux-2.6] / drivers / ata / pata_platform.c
index 6527c56..50400fa 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Based on pata_pcmcia:
  *
- *   Copyright 2005-2006 Red Hat Inc <alan@redhat.com>, all rights reserved.
+ *   Copyright 2005-2006 Red Hat Inc, all rights reserved.
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
@@ -34,14 +34,12 @@ static int pata_platform_set_mode(struct ata_link *link, struct ata_device **unu
 {
        struct ata_device *dev;
 
-       ata_link_for_each_dev(dev, link) {
-               if (ata_dev_enabled(dev)) {
-                       /* We don't really care */
-                       dev->pio_mode = dev->xfer_mode = XFER_PIO_0;
-                       dev->xfer_shift = ATA_SHIFT_PIO;
-                       dev->flags |= ATA_DFLAG_PIO;
-                       ata_dev_printk(dev, KERN_INFO, "configured for PIO\n");
-               }
+       ata_for_each_dev(dev, link, ENABLED) {
+               /* We don't really care */
+               dev->pio_mode = dev->xfer_mode = XFER_PIO_0;
+               dev->xfer_shift = ATA_SHIFT_PIO;
+               dev->flags |= ATA_DFLAG_PIO;
+               ata_dev_printk(dev, KERN_INFO, "configured for PIO\n");
        }
        return 0;
 }
@@ -55,7 +53,6 @@ static struct ata_port_operations pata_platform_port_ops = {
        .sff_data_xfer          = ata_sff_data_xfer_noirq,
        .cable_detect           = ata_cable_unknown,
        .set_mode               = pata_platform_set_mode,
-       .port_start             = ATA_OP_NULL,
 };
 
 static void pata_platform_setup_port(struct ata_ioports *ioaddr,
@@ -153,14 +150,14 @@ int __devinit __pata_platform_probe(struct device *dev,
         */
        if (mmio) {
                ap->ioaddr.cmd_addr = devm_ioremap(dev, io_res->start,
-                               io_res->end - io_res->start + 1);
+                               resource_size(io_res));
                ap->ioaddr.ctl_addr = devm_ioremap(dev, ctl_res->start,
-                               ctl_res->end - ctl_res->start + 1);
+                               resource_size(ctl_res));
        } else {
                ap->ioaddr.cmd_addr = devm_ioport_map(dev, io_res->start,
-                               io_res->end - io_res->start + 1);
+                               resource_size(io_res));
                ap->ioaddr.ctl_addr = devm_ioport_map(dev, ctl_res->start,
-                               ctl_res->end - ctl_res->start + 1);
+                               resource_size(ctl_res));
        }
        if (!ap->ioaddr.cmd_addr || !ap->ioaddr.ctl_addr) {
                dev_err(dev, "failed to map IO/CTL base\n");
@@ -188,7 +185,7 @@ EXPORT_SYMBOL_GPL(__pata_platform_probe);
  *     A platform bus ATA device has been unplugged. Perform the needed
  *     cleanup. Also called on module unload for any active devices.
  */
-int __devexit __pata_platform_remove(struct device *dev)
+int __pata_platform_remove(struct device *dev)
 {
        struct ata_host *host = dev_get_drvdata(dev);
 
@@ -277,3 +274,4 @@ MODULE_AUTHOR("Paul Mundt");
 MODULE_DESCRIPTION("low-level driver for platform device ATA");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_VERSION);
+MODULE_ALIAS("platform:" DRV_NAME);