aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_promise.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-07-31 04:02:40 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-09-29 00:22:28 -0400
commit82ef04fb4c82542b3eda81cca461f0594ce9cd0b (patch)
treee513df5ad8dc9f7400830bfc8786afb6bec90fb6 /drivers/ata/sata_promise.c
parent6ef190cc92e33565accff6a320f0e7d90480bfe7 (diff)
libata: make SCR access ops per-link
Logically, SCR access ops should take @link; however, there was no compelling reason to convert all SCR access ops when adding @link abstraction as there's one-to-one mapping between a port and a non-PMP link. However, that assumption won't hold anymore with the scheduled addition of slave link. Make SCR access ops per-link. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/sata_promise.c')
-rw-r--r--drivers/ata/sata_promise.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index 030665ba76b7..750d8cdc00cd 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -137,8 +137,8 @@ struct pdc_port_priv {
137 dma_addr_t pkt_dma; 137 dma_addr_t pkt_dma;
138}; 138};
139 139
140static int pdc_sata_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val); 140static int pdc_sata_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
141static int pdc_sata_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val); 141static int pdc_sata_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
142static int pdc_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); 142static int pdc_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
143static int pdc_common_port_start(struct ata_port *ap); 143static int pdc_common_port_start(struct ata_port *ap);
144static int pdc_sata_port_start(struct ata_port *ap); 144static int pdc_sata_port_start(struct ata_port *ap);
@@ -386,19 +386,21 @@ static int pdc_sata_cable_detect(struct ata_port *ap)
386 return ATA_CBL_SATA; 386 return ATA_CBL_SATA;
387} 387}
388 388
389static int pdc_sata_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) 389static int pdc_sata_scr_read(struct ata_link *link,
390 unsigned int sc_reg, u32 *val)
390{ 391{
391 if (sc_reg > SCR_CONTROL) 392 if (sc_reg > SCR_CONTROL)
392 return -EINVAL; 393 return -EINVAL;
393 *val = readl(ap->ioaddr.scr_addr + (sc_reg * 4)); 394 *val = readl(link->ap->ioaddr.scr_addr + (sc_reg * 4));
394 return 0; 395 return 0;
395} 396}
396 397
397static int pdc_sata_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val) 398static int pdc_sata_scr_write(struct ata_link *link,
399 unsigned int sc_reg, u32 val)
398{ 400{
399 if (sc_reg > SCR_CONTROL) 401 if (sc_reg > SCR_CONTROL)
400 return -EINVAL; 402 return -EINVAL;
401 writel(val, ap->ioaddr.scr_addr + (sc_reg * 4)); 403 writel(val, link->ap->ioaddr.scr_addr + (sc_reg * 4));
402 return 0; 404 return 0;
403} 405}
404 406
@@ -731,7 +733,7 @@ static void pdc_error_intr(struct ata_port *ap, struct ata_queued_cmd *qc,
731 if (sata_scr_valid(&ap->link)) { 733 if (sata_scr_valid(&ap->link)) {
732 u32 serror; 734 u32 serror;
733 735
734 pdc_sata_scr_read(ap, SCR_ERROR, &serror); 736 pdc_sata_scr_read(&ap->link, SCR_ERROR, &serror);
735 ehi->serror |= serror; 737 ehi->serror |= serror;
736 } 738 }
737 739