diff options
author | Tejun Heo <tj@kernel.org> | 2008-07-31 04:02:40 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-29 00:22:28 -0400 |
commit | 82ef04fb4c82542b3eda81cca461f0594ce9cd0b (patch) | |
tree | e513df5ad8dc9f7400830bfc8786afb6bec90fb6 /drivers/ata/sata_nv.c | |
parent | 6ef190cc92e33565accff6a320f0e7d90480bfe7 (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_nv.c')
-rw-r--r-- | drivers/ata/sata_nv.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 1e1f3f3757ae..88fd4aeacde0 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -302,8 +302,8 @@ static void nv_ck804_host_stop(struct ata_host *host); | |||
302 | static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance); | 302 | static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance); |
303 | static irqreturn_t nv_nf2_interrupt(int irq, void *dev_instance); | 303 | static irqreturn_t nv_nf2_interrupt(int irq, void *dev_instance); |
304 | static irqreturn_t nv_ck804_interrupt(int irq, void *dev_instance); | 304 | static irqreturn_t nv_ck804_interrupt(int irq, void *dev_instance); |
305 | static int nv_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val); | 305 | static int nv_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); |
306 | static int nv_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val); | 306 | static int nv_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); |
307 | 307 | ||
308 | static void nv_nf2_freeze(struct ata_port *ap); | 308 | static void nv_nf2_freeze(struct ata_port *ap); |
309 | static void nv_nf2_thaw(struct ata_port *ap); | 309 | static void nv_nf2_thaw(struct ata_port *ap); |
@@ -1492,21 +1492,21 @@ static irqreturn_t nv_ck804_interrupt(int irq, void *dev_instance) | |||
1492 | return ret; | 1492 | return ret; |
1493 | } | 1493 | } |
1494 | 1494 | ||
1495 | static int nv_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) | 1495 | static int nv_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val) |
1496 | { | 1496 | { |
1497 | if (sc_reg > SCR_CONTROL) | 1497 | if (sc_reg > SCR_CONTROL) |
1498 | return -EINVAL; | 1498 | return -EINVAL; |
1499 | 1499 | ||
1500 | *val = ioread32(ap->ioaddr.scr_addr + (sc_reg * 4)); | 1500 | *val = ioread32(link->ap->ioaddr.scr_addr + (sc_reg * 4)); |
1501 | return 0; | 1501 | return 0; |
1502 | } | 1502 | } |
1503 | 1503 | ||
1504 | static int nv_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val) | 1504 | static int nv_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) |
1505 | { | 1505 | { |
1506 | if (sc_reg > SCR_CONTROL) | 1506 | if (sc_reg > SCR_CONTROL) |
1507 | return -EINVAL; | 1507 | return -EINVAL; |
1508 | 1508 | ||
1509 | iowrite32(val, ap->ioaddr.scr_addr + (sc_reg * 4)); | 1509 | iowrite32(val, link->ap->ioaddr.scr_addr + (sc_reg * 4)); |
1510 | return 0; | 1510 | return 0; |
1511 | } | 1511 | } |
1512 | 1512 | ||
@@ -2184,9 +2184,9 @@ static void nv_swncq_host_interrupt(struct ata_port *ap, u16 fis) | |||
2184 | if (!pp->qc_active) | 2184 | if (!pp->qc_active) |
2185 | return; | 2185 | return; |
2186 | 2186 | ||
2187 | if (ap->ops->scr_read(ap, SCR_ERROR, &serror)) | 2187 | if (ap->ops->scr_read(&ap->link, SCR_ERROR, &serror)) |
2188 | return; | 2188 | return; |
2189 | ap->ops->scr_write(ap, SCR_ERROR, serror); | 2189 | ap->ops->scr_write(&ap->link, SCR_ERROR, serror); |
2190 | 2190 | ||
2191 | if (ata_stat & ATA_ERR) { | 2191 | if (ata_stat & ATA_ERR) { |
2192 | ata_ehi_clear_desc(ehi); | 2192 | ata_ehi_clear_desc(ehi); |