[libata] pata_rb532_cf: fix signature of the xfer function
authorPhil Sutter <n0-1@freewrt.org>
Fri, 28 Nov 2008 19:48:35 +0000 (20:48 +0100)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 1 Dec 2008 18:49:17 +0000 (13:49 -0500)
Per definition, this function should return the number of bytes
consumed. As the original parameter "buflen" is being decremented inside
the read/write loop, save it in "retlen" at the beginning.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Sergei Shtyltov <sshtylyov@ru.mvista.com>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/pata_rb532_cf.c

index 392116c..c2e6fb9 100644 (file)
@@ -74,11 +74,12 @@ static void rb532_pata_exec_command(struct ata_port *ap,
        rb532_pata_finish_io(ap);
 }
 
-static void rb532_pata_data_xfer(struct ata_device *adev, unsigned char *buf,
+static unsigned int rb532_pata_data_xfer(struct ata_device *adev, unsigned char *buf,
                                unsigned int buflen, int write_data)
 {
        struct ata_port *ap = adev->link->ap;
        void __iomem *ioaddr = ap->ioaddr.data_addr;
+       int retlen = buflen;
 
        if (write_data) {
                for (; buflen > 0; buflen--, buf++)
@@ -89,6 +90,7 @@ static void rb532_pata_data_xfer(struct ata_device *adev, unsigned char *buf,
        }
 
        rb532_pata_finish_io(adev->link->ap);
+       return retlen;
 }
 
 static void rb532_pata_freeze(struct ata_port *ap)