diff options
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 79e3a8e7a84..825461a33ab 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -4868,10 +4868,8 @@ int sata_scr_valid(struct ata_link *link) | |||
4868 | int sata_scr_read(struct ata_link *link, int reg, u32 *val) | 4868 | int sata_scr_read(struct ata_link *link, int reg, u32 *val) |
4869 | { | 4869 | { |
4870 | if (ata_is_host_link(link)) { | 4870 | if (ata_is_host_link(link)) { |
4871 | struct ata_port *ap = link->ap; | ||
4872 | |||
4873 | if (sata_scr_valid(link)) | 4871 | if (sata_scr_valid(link)) |
4874 | return ap->ops->scr_read(ap, reg, val); | 4872 | return link->ap->ops->scr_read(link, reg, val); |
4875 | return -EOPNOTSUPP; | 4873 | return -EOPNOTSUPP; |
4876 | } | 4874 | } |
4877 | 4875 | ||
@@ -4897,10 +4895,8 @@ int sata_scr_read(struct ata_link *link, int reg, u32 *val) | |||
4897 | int sata_scr_write(struct ata_link *link, int reg, u32 val) | 4895 | int sata_scr_write(struct ata_link *link, int reg, u32 val) |
4898 | { | 4896 | { |
4899 | if (ata_is_host_link(link)) { | 4897 | if (ata_is_host_link(link)) { |
4900 | struct ata_port *ap = link->ap; | ||
4901 | |||
4902 | if (sata_scr_valid(link)) | 4898 | if (sata_scr_valid(link)) |
4903 | return ap->ops->scr_write(ap, reg, val); | 4899 | return link->ap->ops->scr_write(link, reg, val); |
4904 | return -EOPNOTSUPP; | 4900 | return -EOPNOTSUPP; |
4905 | } | 4901 | } |
4906 | 4902 | ||
@@ -4925,13 +4921,12 @@ int sata_scr_write(struct ata_link *link, int reg, u32 val) | |||
4925 | int sata_scr_write_flush(struct ata_link *link, int reg, u32 val) | 4921 | int sata_scr_write_flush(struct ata_link *link, int reg, u32 val) |
4926 | { | 4922 | { |
4927 | if (ata_is_host_link(link)) { | 4923 | if (ata_is_host_link(link)) { |
4928 | struct ata_port *ap = link->ap; | ||
4929 | int rc; | 4924 | int rc; |
4930 | 4925 | ||
4931 | if (sata_scr_valid(link)) { | 4926 | if (sata_scr_valid(link)) { |
4932 | rc = ap->ops->scr_write(ap, reg, val); | 4927 | rc = link->ap->ops->scr_write(link, reg, val); |
4933 | if (rc == 0) | 4928 | if (rc == 0) |
4934 | rc = ap->ops->scr_read(ap, reg, &val); | 4929 | rc = link->ap->ops->scr_read(link, reg, &val); |
4935 | return rc; | 4930 | return rc; |
4936 | } | 4931 | } |
4937 | return -EOPNOTSUPP; | 4932 | return -EOPNOTSUPP; |