aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_inic162x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/sata_inic162x.c')
-rw-r--r--drivers/ata/sata_inic162x.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index 3de183461c3c..a9c948d7604a 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -190,34 +190,34 @@ static void inic_reset_port(void __iomem *port_base)
190 writew(ctl, idma_ctl); 190 writew(ctl, idma_ctl);
191} 191}
192 192
193static u32 inic_scr_read(struct ata_port *ap, unsigned sc_reg) 193static int inic_scr_read(struct ata_port *ap, unsigned sc_reg, u32 *val)
194{ 194{
195 void __iomem *scr_addr = ap->ioaddr.scr_addr; 195 void __iomem *scr_addr = ap->ioaddr.scr_addr;
196 void __iomem *addr; 196 void __iomem *addr;
197 u32 val;
198 197
199 if (unlikely(sc_reg >= ARRAY_SIZE(scr_map))) 198 if (unlikely(sc_reg >= ARRAY_SIZE(scr_map)))
200 return 0xffffffffU; 199 return -EINVAL;
201 200
202 addr = scr_addr + scr_map[sc_reg] * 4; 201 addr = scr_addr + scr_map[sc_reg] * 4;
203 val = readl(scr_addr + scr_map[sc_reg] * 4); 202 *val = readl(scr_addr + scr_map[sc_reg] * 4);
204 203
205 /* this controller has stuck DIAG.N, ignore it */ 204 /* this controller has stuck DIAG.N, ignore it */
206 if (sc_reg == SCR_ERROR) 205 if (sc_reg == SCR_ERROR)
207 val &= ~SERR_PHYRDY_CHG; 206 *val &= ~SERR_PHYRDY_CHG;
208 return val; 207 return 0;
209} 208}
210 209
211static void inic_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val) 210static int inic_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val)
212{ 211{
213 void __iomem *scr_addr = ap->ioaddr.scr_addr; 212 void __iomem *scr_addr = ap->ioaddr.scr_addr;
214 void __iomem *addr; 213 void __iomem *addr;
215 214
216 if (unlikely(sc_reg >= ARRAY_SIZE(scr_map))) 215 if (unlikely(sc_reg >= ARRAY_SIZE(scr_map)))
217 return; 216 return -EINVAL;
218 217
219 addr = scr_addr + scr_map[sc_reg] * 4; 218 addr = scr_addr + scr_map[sc_reg] * 4;
220 writel(val, scr_addr + scr_map[sc_reg] * 4); 219 writel(val, scr_addr + scr_map[sc_reg] * 4);
220 return 0;
221} 221}
222 222
223/* 223/*