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_sil24.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_sil24.c')
-rw-r--r-- | drivers/ata/sata_sil24.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index e201f1cab66d..46fbbe7f121c 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
@@ -326,8 +326,8 @@ struct sil24_port_priv { | |||
326 | 326 | ||
327 | static void sil24_dev_config(struct ata_device *dev); | 327 | static void sil24_dev_config(struct ata_device *dev); |
328 | static u8 sil24_check_status(struct ata_port *ap); | 328 | static u8 sil24_check_status(struct ata_port *ap); |
329 | static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg); | 329 | static int sil24_scr_read(struct ata_port *ap, unsigned sc_reg, u32 *val); |
330 | static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val); | 330 | static int sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val); |
331 | static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf); | 331 | static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf); |
332 | static void sil24_qc_prep(struct ata_queued_cmd *qc); | 332 | static void sil24_qc_prep(struct ata_queued_cmd *qc); |
333 | static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc); | 333 | static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc); |
@@ -488,25 +488,30 @@ static int sil24_scr_map[] = { | |||
488 | [SCR_ACTIVE] = 3, | 488 | [SCR_ACTIVE] = 3, |
489 | }; | 489 | }; |
490 | 490 | ||
491 | static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg) | 491 | static int sil24_scr_read(struct ata_port *ap, unsigned sc_reg, u32 *val) |
492 | { | 492 | { |
493 | void __iomem *scr_addr = ap->ioaddr.scr_addr; | 493 | void __iomem *scr_addr = ap->ioaddr.scr_addr; |
494 | |||
494 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { | 495 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { |
495 | void __iomem *addr; | 496 | void __iomem *addr; |
496 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; | 497 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; |
497 | return readl(scr_addr + sil24_scr_map[sc_reg] * 4); | 498 | *val = readl(scr_addr + sil24_scr_map[sc_reg] * 4); |
499 | return 0; | ||
498 | } | 500 | } |
499 | return 0xffffffffU; | 501 | return -EINVAL; |
500 | } | 502 | } |
501 | 503 | ||
502 | static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val) | 504 | static int sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val) |
503 | { | 505 | { |
504 | void __iomem *scr_addr = ap->ioaddr.scr_addr; | 506 | void __iomem *scr_addr = ap->ioaddr.scr_addr; |
507 | |||
505 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { | 508 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { |
506 | void __iomem *addr; | 509 | void __iomem *addr; |
507 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; | 510 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; |
508 | writel(val, scr_addr + sil24_scr_map[sc_reg] * 4); | 511 | writel(val, scr_addr + sil24_scr_map[sc_reg] * 4); |
512 | return 0; | ||
509 | } | 513 | } |
514 | return -EINVAL; | ||
510 | } | 515 | } |
511 | 516 | ||
512 | static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf) | 517 | static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf) |