summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla2xxx/qla_sup.c
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2019-08-08 20:01:59 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2019-08-12 21:34:07 -0400
commitc43e7832ee77daadf147876b93f23035b89fa028 (patch)
tree7015ee97550d55380f9a519de535ab7c6e1eca79 /drivers/scsi/qla2xxx/qla_sup.c
parentdf95f39ae76474d922d9be9c0260dc263c451b09 (diff)
scsi: qla2xxx: Change the return type of qla24xx_read_flash_data()
This change makes it easier to detect qla24xx_read_flash_data() failures and also to handle such failures. This change does not modify the behavior of the driver since all callers ignore the qla24xx_read_flash_data() return value. Cc: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Tested-by: Himanshu Madhani <hmadhani@marvell.com> Reviewed-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_sup.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_sup.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index 1eb82384d933..764e1bb0f695 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -473,22 +473,24 @@ qla24xx_read_flash_dword(struct qla_hw_data *ha, uint32_t addr, uint32_t *data)
return QLA_FUNCTION_TIMEOUT;
}
-uint32_t *
+int
qla24xx_read_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,
uint32_t dwords)
{
ulong i;
+ int ret = QLA_SUCCESS;
struct qla_hw_data *ha = vha->hw;
/* Dword reads to flash. */
faddr = flash_data_addr(ha, faddr);
for (i = 0; i < dwords; i++, faddr++, dwptr++) {
- if (qla24xx_read_flash_dword(ha, faddr, dwptr))
+ ret = qla24xx_read_flash_dword(ha, faddr, dwptr);
+ if (ret != QLA_SUCCESS)
break;
cpu_to_le32s(dwptr);
}
- return dwptr;
+ return ret;
}
static int