diff mbox series

[03/13] scsi: ufs: qcom: Fix the return value when platform_get_resource_byname() fails

Message ID 20231201151417.65500-4-manivannan.sadhasivam@linaro.org
State Superseded
Headers show
Series scsi: ufs: qcom: Minor code cleanups | expand

Commit Message

Manivannan Sadhasivam Dec. 1, 2023, 3:14 p.m. UTC
The return value should be -ENODEV indicating that the resource is not
provided in DT, not -ENOMEM. Fix it!

Fixes: c263b4ef737e ("scsi: ufs: core: mcq: Configure resource regions")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/ufs/host/ufs-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Halaney Dec. 6, 2023, 6:11 p.m. UTC | #1
On Fri, Dec 01, 2023 at 08:44:07PM +0530, Manivannan Sadhasivam wrote:
> The return value should be -ENODEV indicating that the resource is not
> provided in DT, not -ENOMEM. Fix it!
> 
> Fixes: c263b4ef737e ("scsi: ufs: core: mcq: Configure resource regions")
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Reviewed-by: Andrew Halaney <ahalaney@redhat.com>

> ---
>  drivers/ufs/host/ufs-qcom.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 852179e456f2..778df0a9c65e 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -1701,7 +1701,7 @@ static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba)
>  		if (!res->resource) {
>  			dev_info(hba->dev, "Resource %s not provided\n", res->name);
>  			if (i == RES_UFS)
> -				return -ENOMEM;
> +				return -ENODEV;
>  			continue;
>  		} else if (i == RES_UFS) {
>  			res_mem = res->resource;
> -- 
> 2.25.1
> 
>
diff mbox series

Patch

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 852179e456f2..778df0a9c65e 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -1701,7 +1701,7 @@  static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba)
 		if (!res->resource) {
 			dev_info(hba->dev, "Resource %s not provided\n", res->name);
 			if (i == RES_UFS)
-				return -ENOMEM;
+				return -ENODEV;
 			continue;
 		} else if (i == RES_UFS) {
 			res_mem = res->resource;