aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorSimon Glass2017-06-14 21:28:44 -0600
committerSimon Glass2017-07-11 10:08:19 -0600
commitf6580ef39b332387f84334d238320ce99115af67 (patch)
treeb78bf42fde9e8fe489336498f558053cb7ac48bb /drivers/scsi
parentf6ab5a92acc78371fc088075b64bd394d1f0d45f (diff)
dm: scsi: Adjust return value of scsi_exec()
Change this function to return an error number instead of true/false. This allows us to return a proper error number. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index f3f8d31e1a4..80c5ce699e6 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -368,7 +368,7 @@ static int scsi_read_capacity(struct udevice *dev, struct scsi_cmd *pccb,
pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */
pccb->datalen = 8;
- if (scsi_exec(dev, pccb) != true)
+ if (scsi_exec(dev, pccb))
return 1;
*capacity = ((lbaint_t)pccb->pdata[0] << 24) |
@@ -393,7 +393,7 @@ static int scsi_read_capacity(struct udevice *dev, struct scsi_cmd *pccb,
pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */
pccb->datalen = 16;
- if (scsi_exec(dev, pccb) != true)
+ if (scsi_exec(dev, pccb))
return 1;
*capacity = ((uint64_t)pccb->pdata[0] << 56) |
@@ -499,7 +499,7 @@ static int scsi_detect_dev(struct udevice *dev, int target, int lun,
pccb->pdata = (unsigned char *)&tempbuff;
pccb->datalen = 512;
scsi_setup_inquiry(pccb);
- if (scsi_exec(dev, pccb) != true) {
+ if (scsi_exec(dev, pccb)) {
if (pccb->contr_stat == SCSI_SEL_TIME_OUT) {
/*
* selection timeout => assuming no
@@ -530,7 +530,7 @@ static int scsi_detect_dev(struct udevice *dev, int target, int lun,
pccb->datalen = 0;
scsi_setup_test_unit_ready(pccb);
- if (scsi_exec(dev, pccb) != true) {
+ if (scsi_exec(dev, pccb)) {
if (dev_desc->removable) {
dev_desc->type = perq;
goto removable;