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/libata-core.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/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index ecbc3278238a..5718c247e23a 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -5732,10 +5732,8 @@ int sata_scr_valid(struct ata_port *ap) | |||
5732 | */ | 5732 | */ |
5733 | int sata_scr_read(struct ata_port *ap, int reg, u32 *val) | 5733 | int sata_scr_read(struct ata_port *ap, int reg, u32 *val) |
5734 | { | 5734 | { |
5735 | if (sata_scr_valid(ap)) { | 5735 | if (sata_scr_valid(ap)) |
5736 | *val = ap->ops->scr_read(ap, reg); | 5736 | return ap->ops->scr_read(ap, reg, val); |
5737 | return 0; | ||
5738 | } | ||
5739 | return -EOPNOTSUPP; | 5737 | return -EOPNOTSUPP; |
5740 | } | 5738 | } |
5741 | 5739 | ||
@@ -5757,10 +5755,8 @@ int sata_scr_read(struct ata_port *ap, int reg, u32 *val) | |||
5757 | */ | 5755 | */ |
5758 | int sata_scr_write(struct ata_port *ap, int reg, u32 val) | 5756 | int sata_scr_write(struct ata_port *ap, int reg, u32 val) |
5759 | { | 5757 | { |
5760 | if (sata_scr_valid(ap)) { | 5758 | if (sata_scr_valid(ap)) |
5761 | ap->ops->scr_write(ap, reg, val); | 5759 | return ap->ops->scr_write(ap, reg, val); |
5762 | return 0; | ||
5763 | } | ||
5764 | return -EOPNOTSUPP; | 5760 | return -EOPNOTSUPP; |
5765 | } | 5761 | } |
5766 | 5762 | ||
@@ -5781,10 +5777,13 @@ int sata_scr_write(struct ata_port *ap, int reg, u32 val) | |||
5781 | */ | 5777 | */ |
5782 | int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val) | 5778 | int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val) |
5783 | { | 5779 | { |
5780 | int rc; | ||
5781 | |||
5784 | if (sata_scr_valid(ap)) { | 5782 | if (sata_scr_valid(ap)) { |
5785 | ap->ops->scr_write(ap, reg, val); | 5783 | rc = ap->ops->scr_write(ap, reg, val); |
5786 | ap->ops->scr_read(ap, reg); | 5784 | if (rc == 0) |
5787 | return 0; | 5785 | rc = ap->ops->scr_read(ap, reg, &val); |
5786 | return rc; | ||
5788 | } | 5787 | } |
5789 | return -EOPNOTSUPP; | 5788 | return -EOPNOTSUPP; |
5790 | } | 5789 | } |