diff options
author | Phil Sutter <n0-1@freewrt.org> | 2008-11-28 14:48:35 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-12-01 13:49:17 -0500 |
commit | 03f60840fa462e92220b093f778b2426ceab23af (patch) | |
tree | 5770676fec230ddee8357b3210890f34f80a6bf8 /drivers/ata/pata_rb532_cf.c | |
parent | 9f14786e27908a176f0568cf2132558efef71b31 (diff) |
[libata] pata_rb532_cf: fix signature of the xfer function
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>
Diffstat (limited to 'drivers/ata/pata_rb532_cf.c')
-rw-r--r-- | drivers/ata/pata_rb532_cf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c index 392116c1c16a..c2e6fb9f2ef9 100644 --- a/drivers/ata/pata_rb532_cf.c +++ b/drivers/ata/pata_rb532_cf.c | |||
@@ -74,11 +74,12 @@ static void rb532_pata_exec_command(struct ata_port *ap, | |||
74 | rb532_pata_finish_io(ap); | 74 | rb532_pata_finish_io(ap); |
75 | } | 75 | } |
76 | 76 | ||
77 | static void rb532_pata_data_xfer(struct ata_device *adev, unsigned char *buf, | 77 | static unsigned int rb532_pata_data_xfer(struct ata_device *adev, unsigned char *buf, |
78 | unsigned int buflen, int write_data) | 78 | unsigned int buflen, int write_data) |
79 | { | 79 | { |
80 | struct ata_port *ap = adev->link->ap; | 80 | struct ata_port *ap = adev->link->ap; |
81 | void __iomem *ioaddr = ap->ioaddr.data_addr; | 81 | void __iomem *ioaddr = ap->ioaddr.data_addr; |
82 | int retlen = buflen; | ||
82 | 83 | ||
83 | if (write_data) { | 84 | if (write_data) { |
84 | for (; buflen > 0; buflen--, buf++) | 85 | for (; buflen > 0; buflen--, buf++) |
@@ -89,6 +90,7 @@ static void rb532_pata_data_xfer(struct ata_device *adev, unsigned char *buf, | |||
89 | } | 90 | } |
90 | 91 | ||
91 | rb532_pata_finish_io(adev->link->ap); | 92 | rb532_pata_finish_io(adev->link->ap); |
93 | return retlen; | ||
92 | } | 94 | } |
93 | 95 | ||
94 | static void rb532_pata_freeze(struct ata_port *ap) | 96 | static void rb532_pata_freeze(struct ata_port *ap) |