2020-11-16 09:15:36

by Kaixu Xia

[permalink] [raw]
Subject: [PATCH v2] phy: mapphone-mdm6600: return error when timed out powering up

From: Kaixu Xia <[email protected]>

The value of variable error is overwritten by the following call
devm_request_threaded_irq() in phy_mdm6600_device_power_on(), actually
we should return error when timed out powering up.

Reported-by: Tosk Robot <[email protected]>
Signed-off-by: Kaixu Xia <[email protected]>
---
v2:
-directly return error when timed out powering.

drivers/phy/motorola/phy-mapphone-mdm6600.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c
index 5172971f4c36..2f461c0d7276 100644
--- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
+++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
@@ -423,6 +423,7 @@ static int phy_mdm6600_device_power_on(struct phy_mdm6600 *ddata)
ddata->enabled = false;
error = -ETIMEDOUT;
dev_err(ddata->dev, "Timed out powering up\n");
+ return error;
}

/* Reconfigure mode1 GPIO as input for OOB wake */
--
2.20.0


2020-11-16 09:44:42

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH v2] phy: mapphone-mdm6600: return error when timed out powering up

On 16-11-20, 17:11, [email protected] wrote:
> From: Kaixu Xia <[email protected]>
>
> The value of variable error is overwritten by the following call
> devm_request_threaded_irq() in phy_mdm6600_device_power_on(), actually
> we should return error when timed out powering up.
>
> Reported-by: Tosk Robot <[email protected]>
> Signed-off-by: Kaixu Xia <[email protected]>
> ---
> v2:
> -directly return error when timed out powering.
>
> drivers/phy/motorola/phy-mapphone-mdm6600.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c
> index 5172971f4c36..2f461c0d7276 100644
> --- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
> +++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
> @@ -423,6 +423,7 @@ static int phy_mdm6600_device_power_on(struct phy_mdm6600 *ddata)
> ddata->enabled = false;
> error = -ETIMEDOUT;

or drop this
> dev_err(ddata->dev, "Timed out powering up\n");
> + return error;

and do:
return -ETIMEDOUT;


> }
>
> /* Reconfigure mode1 GPIO as input for OOB wake */
> --
> 2.20.0

--
~Vinod