diff options
author | Tejun Heo <htejun@gmail.com> | 2007-07-16 01:29:40 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-20 08:02:11 -0400 |
commit | da3dbb17a0e9a9ec7f5aed95f1fddadb790edc9d (patch) | |
tree | 289239e1eb60168321e905c545aa2e2f3a2b5475 /drivers/ata/sata_inic162x.c | |
parent | 5335b729064e03319cd2d5219770451dbb1d7f67 (diff) |
libata: make ->scr_read/write callbacks return error code
Convert ->scr_read/write callbacks to return error code to better
indicate failure. This will help handling of SCR_NOTIFICATION.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/sata_inic162x.c')
-rw-r--r-- | drivers/ata/sata_inic162x.c | 16 |
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 | ||
193 | static u32 inic_scr_read(struct ata_port *ap, unsigned sc_reg) | 193 | static 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 | ||
211 | static void inic_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val) | 210 | static 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 | /* |