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_qdi.c
index 0d81dd5..45879dc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *    pata_qdi.c - QDI VLB ATA controllers
- *     (C) 2006 Red Hat <alan@redhat.com>
+ *     (C) 2006 Red Hat
  *
  * This driver mostly exists as a proof of concept for non PCI devices under
  * libata. While the QDI6580 was 'neat' in 1993 it is no longer terribly
@@ -12,7 +12,7 @@
  *
  * Probe code based on drivers/ide/legacy/qd65xx.c
  * Rewritten from the work of Colten Edwards <pje120@cs.usask.ca> by
- * Samuel Thibault <samuel.thibault@fnac.net>
+ * Samuel Thibault <samuel.thibault@ens-lyon.org>
  */
 
 #include <linux/kernel.h>
@@ -60,11 +60,11 @@ static void qdi6500_set_piomode(struct ata_port *ap, struct ata_device *adev)
        ata_timing_compute(adev, adev->pio_mode, &t, 30303, 1000);
 
        if (qdi->fast) {
-               active = 8 - FIT(t.active, 1, 8);
-               recovery = 18 - FIT(t.recover, 3, 18);
+               active = 8 - clamp_val(t.active, 1, 8);
+               recovery = 18 - clamp_val(t.recover, 3, 18);
        } else {
-               active = 9 - FIT(t.active, 2, 9);
-               recovery = 15 - FIT(t.recover, 0, 15);
+               active = 9 - clamp_val(t.active, 2, 9);
+               recovery = 15 - clamp_val(t.recover, 0, 15);
        }
        timing = (recovery << 4) | active | 0x08;
 
@@ -84,11 +84,11 @@ static void qdi6580_set_piomode(struct ata_port *ap, struct ata_device *adev)
        ata_timing_compute(adev, adev->pio_mode, &t, 30303, 1000);
 
        if (qdi->fast) {
-               active = 8 - FIT(t.active, 1, 8);
-               recovery = 18 - FIT(t.recover, 3, 18);
+               active = 8 - clamp_val(t.active, 1, 8);
+               recovery = 18 - clamp_val(t.recover, 3, 18);
        } else {
-               active = 9 - FIT(t.active, 2, 9);
-               recovery = 15 - FIT(t.recover, 0, 15);
+               active = 9 - clamp_val(t.active, 2, 9);
+               recovery = 15 - clamp_val(t.recover, 0, 15);
        }
        timing = (recovery << 4) | active | 0x08;
 
@@ -137,7 +137,7 @@ static unsigned int qdi_data_xfer(struct ata_device *dev, unsigned char *buf,
                        iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
 
                if (unlikely(slop)) {
-                       u32 pad;
+                       __le32 pad;
                        if (rw == READ) {
                                pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr));
                                memcpy(buf + buflen - slop, &pad, slop);
@@ -160,7 +160,7 @@ static struct scsi_host_template qdi_sht = {
 static struct ata_port_operations qdi6500_port_ops = {
        .inherits       = &ata_sff_port_ops,
        .qc_issue       = qdi_qc_issue,
-       .data_xfer      = qdi_data_xfer,
+       .sff_data_xfer  = qdi_data_xfer,
        .cable_detect   = ata_cable_40wire,
        .set_piomode    = qdi6500_set_piomode,
 };
@@ -212,11 +212,11 @@ static __init int qdi_init_one(unsigned long port, int type, unsigned long io, i
 
        if (type == 6580) {
                ap->ops = &qdi6580_port_ops;
-               ap->pio_mask = 0x1F;
+               ap->pio_mask = ATA_PIO4;
                ap->flags |= ATA_FLAG_SLAVE_POSS;
        } else {
                ap->ops = &qdi6500_port_ops;
-               ap->pio_mask = 0x07;    /* Actually PIO3 !IORDY is possible */
+               ap->pio_mask = ATA_PIO2; /* Actually PIO3 !IORDY is possible */
                ap->flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_NO_IORDY;
        }