2020-08-02 11:16:52

by Tianjia Zhang

[permalink] [raw]
Subject: [PATCH] phy: qcom-ufs: Fix wrong return value in ufs_qcom_phy_calibrate()

On an error exit path, a negative error code should be returned
instead of a positive return value.

Fixes: adaafaa393ef1 ("phy: qcom-ufs: add support for QUALCOMM Technologies UFS PHY drivers")
Cc: Yaniv Gardi <[email protected]>
Signed-off-by: Tianjia Zhang <[email protected]>
---
drivers/phy/qualcomm/phy-qcom-ufs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-ufs.c b/drivers/phy/qualcomm/phy-qcom-ufs.c
index 763c8d396af1..49d47dc5bfd4 100644
--- a/drivers/phy/qualcomm/phy-qcom-ufs.c
+++ b/drivers/phy/qualcomm/phy-qcom-ufs.c
@@ -24,7 +24,7 @@ int ufs_qcom_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy,

if (!tbl_A) {
dev_err(ufs_qcom_phy->dev, "%s: tbl_A is NULL", __func__);
- ret = EINVAL;
+ ret = -EINVAL;
goto out;
}

@@ -42,7 +42,7 @@ int ufs_qcom_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy,
if (!tbl_B) {
dev_err(ufs_qcom_phy->dev, "%s: tbl_B is NULL",
__func__);
- ret = EINVAL;
+ ret = -EINVAL;
goto out;
}

--
2.26.2


2020-08-04 06:05:42

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH] phy: qcom-ufs: Fix wrong return value in ufs_qcom_phy_calibrate()

On Sun 02 Aug 04:15 PDT 2020, Tianjia Zhang wrote:

> On an error exit path, a negative error code should be returned
> instead of a positive return value.
>
> Fixes: adaafaa393ef1 ("phy: qcom-ufs: add support for QUALCOMM Technologies UFS PHY drivers")
> Cc: Yaniv Gardi <[email protected]>
> Signed-off-by: Tianjia Zhang <[email protected]>

Thanks for your patch Tianjia.

The support provided by this driver was added to phy-qcom-qmp.c a while
back and in what's will become 5.9 the phy-qcom-ufs.c driver is removed.
So your change is unfortunately no longer needed.

Regards,
Bjorn

> ---
> drivers/phy/qualcomm/phy-qcom-ufs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-ufs.c b/drivers/phy/qualcomm/phy-qcom-ufs.c
> index 763c8d396af1..49d47dc5bfd4 100644
> --- a/drivers/phy/qualcomm/phy-qcom-ufs.c
> +++ b/drivers/phy/qualcomm/phy-qcom-ufs.c
> @@ -24,7 +24,7 @@ int ufs_qcom_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy,
>
> if (!tbl_A) {
> dev_err(ufs_qcom_phy->dev, "%s: tbl_A is NULL", __func__);
> - ret = EINVAL;
> + ret = -EINVAL;
> goto out;
> }
>
> @@ -42,7 +42,7 @@ int ufs_qcom_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy,
> if (!tbl_B) {
> dev_err(ufs_qcom_phy->dev, "%s: tbl_B is NULL",
> __func__);
> - ret = EINVAL;
> + ret = -EINVAL;
> goto out;
> }
>
> --
> 2.26.2
>