summaryrefslogtreecommitdiff
path: root/drivers/bus/mhi
diff options
context:
space:
mode:
authorJeffrey Hugo <quic_jhugo@quicinc.com>2023-03-24 19:21:00 +0300
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>2023-04-03 08:18:17 +0300
commit446271e5d7bcb5f1c70bc35b11abbd92e6bb4378 (patch)
tree5ad2d6d8bec10d2ae54734c95dab8fb1395cfd0a /drivers/bus/mhi
parent6a0c637bfee69a74c104468544d9f2a6579626d0 (diff)
downloadlinux-446271e5d7bcb5f1c70bc35b11abbd92e6bb4378.tar.xz
bus: mhi: host: Use ERANGE for BHIOFF/BHIEOFF range check
If the BHIOFF or BHIEOFF range checks fail, they return EINVAL. ERANGE is a better error code since it implies an out of range condition. Suggested-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> Link: https://lore.kernel.org/r/1679674860-28229-1-git-send-email-quic_jhugo@quicinc.com Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Diffstat (limited to 'drivers/bus/mhi')
-rw-r--r--drivers/bus/mhi/host/init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/bus/mhi/host/init.c b/drivers/bus/mhi/host/init.c
index b46a0821adf9..f72fcb66f408 100644
--- a/drivers/bus/mhi/host/init.c
+++ b/drivers/bus/mhi/host/init.c
@@ -1112,7 +1112,7 @@ int mhi_prepare_for_power_up(struct mhi_controller *mhi_cntrl)
if (bhi_off >= mhi_cntrl->reg_len) {
dev_err(dev, "BHI offset: 0x%x is out of range: 0x%zx\n",
bhi_off, mhi_cntrl->reg_len);
- ret = -EINVAL;
+ ret = -ERANGE;
goto error_reg_offset;
}
mhi_cntrl->bhi = mhi_cntrl->regs + bhi_off;
@@ -1129,7 +1129,7 @@ int mhi_prepare_for_power_up(struct mhi_controller *mhi_cntrl)
dev_err(dev,
"BHIe offset: 0x%x is out of range: 0x%zx\n",
bhie_off, mhi_cntrl->reg_len);
- ret = -EINVAL;
+ ret = -ERANGE;
goto error_reg_offset;
}
mhi_cntrl->bhie = mhi_cntrl->regs + bhie_off;