aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorPhil Sutter <n0-1@freewrt.org>2009-01-27 08:35:52 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-03-24 22:02:39 -0400
commit180bd147f18316d92bd5f59aebc9932cabc03edd (patch)
treed22e40de0ad6b81d203d97218a11775ad1cab4cd /drivers/ata
parentbff9ad3c4c8fff340854d3912196ed470f94602c (diff)
pata-rb532-cf: use ata_sff_data_xfer32()
The biggest difference between rb532_pata_data_xfer() and ata_sff_data_xfer32() is the call to ata_sff_pause() at the end of rb532_pata_data_xfer() which I suppose to be unnecessary since it works without. I've also tested using ata_sff_data_xfer() as replacement, but since we know that the driver supports 32bit IO, using the optimised version should be safe. Signed-off-by: Phil Sutter <n0-1@freewrt.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_rb532_cf.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c
index 9d61ce51e4e0..9fb91e4dd887 100644
--- a/drivers/ata/pata_rb532_cf.c
+++ b/drivers/ata/pata_rb532_cf.c
@@ -54,25 +54,6 @@ struct rb532_cf_info {
54 54
55/* ------------------------------------------------------------------------ */ 55/* ------------------------------------------------------------------------ */
56 56
57static unsigned int rb532_pata_data_xfer(struct ata_device *adev, unsigned char *buf,
58 unsigned int buflen, int write_data)
59{
60 struct ata_port *ap = adev->link->ap;
61 void __iomem *ioaddr = ap->ioaddr.data_addr;
62 int retlen = buflen;
63
64 if (write_data) {
65 for (; buflen > 0; buflen--, buf++)
66 writeb(*buf, ioaddr);
67 } else {
68 for (; buflen > 0; buflen--, buf++)
69 *buf = readb(ioaddr);
70 }
71
72 ata_sff_pause(ap);
73 return retlen;
74}
75
76static void rb532_pata_freeze(struct ata_port *ap) 57static void rb532_pata_freeze(struct ata_port *ap)
77{ 58{
78 struct rb532_cf_info *info = ap->host->private_data; 59 struct rb532_cf_info *info = ap->host->private_data;
@@ -105,7 +86,7 @@ static irqreturn_t rb532_pata_irq_handler(int irq, void *dev_instance)
105 86
106static struct ata_port_operations rb532_pata_port_ops = { 87static struct ata_port_operations rb532_pata_port_ops = {
107 .inherits = &ata_sff_port_ops, 88 .inherits = &ata_sff_port_ops,
108 .sff_data_xfer = rb532_pata_data_xfer, 89 .sff_data_xfer = ata_sff_data_xfer32,
109 .freeze = rb532_pata_freeze, 90 .freeze = rb532_pata_freeze,
110 .thaw = rb532_pata_thaw, 91 .thaw = rb532_pata_thaw,
111}; 92};