aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_mv.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_mv.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_mv.c')
-rw-r--r--drivers/ata/sata_mv.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index c815f8ecf6e6..2b24ae58b52e 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -493,10 +493,10 @@ struct mv_hw_ops {
493 void (*reset_bus)(struct ata_host *host, void __iomem *mmio); 493 void (*reset_bus)(struct ata_host *host, void __iomem *mmio);
494}; 494};
495 495
496static int mv_scr_read(struct ata_port *ap, unsigned int sc_reg_in, u32 *val); 496static int mv_scr_read(struct ata_link *link, unsigned int sc_reg_in, u32 *val);
497static int mv_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val); 497static int mv_scr_write(struct ata_link *link, unsigned int sc_reg_in, u32 val);
498static int mv5_scr_read(struct ata_port *ap, unsigned int sc_reg_in, u32 *val); 498static int mv5_scr_read(struct ata_link *link, unsigned int sc_reg_in, u32 *val);
499static int mv5_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val); 499static int mv5_scr_write(struct ata_link *link, unsigned int sc_reg_in, u32 val);
500static int mv_port_start(struct ata_port *ap); 500static int mv_port_start(struct ata_port *ap);
501static void mv_port_stop(struct ata_port *ap); 501static void mv_port_stop(struct ata_port *ap);
502static int mv_qc_defer(struct ata_queued_cmd *qc); 502static int mv_qc_defer(struct ata_queued_cmd *qc);
@@ -1070,23 +1070,23 @@ static unsigned int mv_scr_offset(unsigned int sc_reg_in)
1070 return ofs; 1070 return ofs;
1071} 1071}
1072 1072
1073static int mv_scr_read(struct ata_port *ap, unsigned int sc_reg_in, u32 *val) 1073static int mv_scr_read(struct ata_link *link, unsigned int sc_reg_in, u32 *val)
1074{ 1074{
1075 unsigned int ofs = mv_scr_offset(sc_reg_in); 1075 unsigned int ofs = mv_scr_offset(sc_reg_in);
1076 1076
1077 if (ofs != 0xffffffffU) { 1077 if (ofs != 0xffffffffU) {
1078 *val = readl(mv_ap_base(ap) + ofs); 1078 *val = readl(mv_ap_base(link->ap) + ofs);
1079 return 0; 1079 return 0;
1080 } else 1080 } else
1081 return -EINVAL; 1081 return -EINVAL;
1082} 1082}
1083 1083
1084static int mv_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val) 1084static int mv_scr_write(struct ata_link *link, unsigned int sc_reg_in, u32 val)
1085{ 1085{
1086 unsigned int ofs = mv_scr_offset(sc_reg_in); 1086 unsigned int ofs = mv_scr_offset(sc_reg_in);
1087 1087
1088 if (ofs != 0xffffffffU) { 1088 if (ofs != 0xffffffffU) {
1089 writelfl(val, mv_ap_base(ap) + ofs); 1089 writelfl(val, mv_ap_base(link->ap) + ofs);
1090 return 0; 1090 return 0;
1091 } else 1091 } else
1092 return -EINVAL; 1092 return -EINVAL;
@@ -2251,11 +2251,11 @@ static unsigned int mv5_scr_offset(unsigned int sc_reg_in)
2251 return ofs; 2251 return ofs;
2252} 2252}
2253 2253
2254static int mv5_scr_read(struct ata_port *ap, unsigned int sc_reg_in, u32 *val) 2254static int mv5_scr_read(struct ata_link *link, unsigned int sc_reg_in, u32 *val)
2255{ 2255{
2256 struct mv_host_priv *hpriv = ap->host->private_data; 2256 struct mv_host_priv *hpriv = link->ap->host->private_data;
2257 void __iomem *mmio = hpriv->base; 2257 void __iomem *mmio = hpriv->base;
2258 void __iomem *addr = mv5_phy_base(mmio, ap->port_no); 2258 void __iomem *addr = mv5_phy_base(mmio, link->ap->port_no);
2259 unsigned int ofs = mv5_scr_offset(sc_reg_in); 2259 unsigned int ofs = mv5_scr_offset(sc_reg_in);
2260 2260
2261 if (ofs != 0xffffffffU) { 2261 if (ofs != 0xffffffffU) {
@@ -2265,11 +2265,11 @@ static int mv5_scr_read(struct ata_port *ap, unsigned int sc_reg_in, u32 *val)
2265 return -EINVAL; 2265 return -EINVAL;
2266} 2266}
2267 2267
2268static int mv5_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val) 2268static int mv5_scr_write(struct ata_link *link, unsigned int sc_reg_in, u32 val)
2269{ 2269{
2270 struct mv_host_priv *hpriv = ap->host->private_data; 2270 struct mv_host_priv *hpriv = link->ap->host->private_data;
2271 void __iomem *mmio = hpriv->base; 2271 void __iomem *mmio = hpriv->base;
2272 void __iomem *addr = mv5_phy_base(mmio, ap->port_no); 2272 void __iomem *addr = mv5_phy_base(mmio, link->ap->port_no);
2273 unsigned int ofs = mv5_scr_offset(sc_reg_in); 2273 unsigned int ofs = mv5_scr_offset(sc_reg_in);
2274 2274
2275 if (ofs != 0xffffffffU) { 2275 if (ofs != 0xffffffffU) {