]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/ata/pata_legacy.c
[libata] convert drivers to use ata.h mode mask defines
[mv-sheeva.git] / drivers / ata / pata_legacy.c
index 6c1d778b63a9cd58a06dc4772fcfc15f8350d428..3f830f0fe2cc515884452253420b14980781d3d3 100644 (file)
@@ -129,7 +129,7 @@ static int qdi;                     /* Set to probe QDI controllers */
 static int winbond;            /* Set to probe Winbond controllers,
                                        give I/O port if non standard */
 static int autospeed;          /* Chip present which snoops speed changes */
-static int pio_mask = 0x1F;    /* PIO range for autospeed devices */
+static int pio_mask = ATA_PIO4;        /* PIO range for autospeed devices */
 static int iordy_mask = 0xFFFFFFFF;    /* Use iordy if available */
 
 /**
@@ -283,9 +283,10 @@ static void pdc20230_set_piomode(struct ata_port *ap, struct ata_device *adev)
 static unsigned int pdc_data_xfer_vlb(struct ata_device *dev,
                        unsigned char *buf, unsigned int buflen, int rw)
 {
-       if (ata_id_has_dword_io(dev->id)) {
+       int slop = buflen & 3;
+       /* 32bit I/O capable *and* we need to write a whole number of dwords */
+       if (ata_id_has_dword_io(dev->id) && (slop == 0 || slop == 3)) {
                struct ata_port *ap = dev->link->ap;
-               int slop = buflen & 3;
                unsigned long flags;
 
                local_irq_save(flags);
@@ -735,7 +736,7 @@ static unsigned int vlb32_data_xfer(struct ata_device *adev, unsigned char *buf,
        struct ata_port *ap = adev->link->ap;
        int slop = buflen & 3;
 
-       if (ata_id_has_dword_io(adev->id)) {
+       if (ata_id_has_dword_io(adev->id) && (slop == 0 || slop == 3)) {
                if (rw == WRITE)
                        iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
                else