diff mbox series

cpufreq: imx6q-cpufreq: Improve the logic of -EPROBE_DEFER handling

Message ID 1584419934-2303-1-git-send-email-Anson.Huang@nxp.com (mailing list archive)
State Mainlined
Commit 74a189ef079090f186e3abd6be295615cd9bf3b1
Headers show
Series cpufreq: imx6q-cpufreq: Improve the logic of -EPROBE_DEFER handling | expand

Commit Message

Anson Huang March 17, 2020, 4:38 a.m. UTC
Improve the -EPROBE_DEFER handling logic to simplify the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/cpufreq/imx6q-cpufreq.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Viresh Kumar March 17, 2020, 8:03 a.m. UTC | #1
On 17-03-20, 12:38, Anson Huang wrote:
> Improve the -EPROBE_DEFER handling logic to simplify the code.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
>  drivers/cpufreq/imx6q-cpufreq.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
> index 285b8e9..fdb2fff 100644
> --- a/drivers/cpufreq/imx6q-cpufreq.c
> +++ b/drivers/cpufreq/imx6q-cpufreq.c
> @@ -400,11 +400,9 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
>  		ret = imx6q_opp_check_speed_grading(cpu_dev);
>  	}
>  	if (ret) {
> -		if (ret == -EPROBE_DEFER)
> -			goto out_free_opp;
> -
> -		dev_err(cpu_dev, "failed to read ocotp: %d\n",
> -			ret);
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(cpu_dev, "failed to read ocotp: %d\n",
> +				ret);
>  		goto out_free_opp;
>  	}

Applied. Thanks.
diff mbox series

Patch

diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
index 285b8e9..fdb2fff 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -400,11 +400,9 @@  static int imx6q_cpufreq_probe(struct platform_device *pdev)
 		ret = imx6q_opp_check_speed_grading(cpu_dev);
 	}
 	if (ret) {
-		if (ret == -EPROBE_DEFER)
-			goto out_free_opp;
-
-		dev_err(cpu_dev, "failed to read ocotp: %d\n",
-			ret);
+		if (ret != -EPROBE_DEFER)
+			dev_err(cpu_dev, "failed to read ocotp: %d\n",
+				ret);
 		goto out_free_opp;
 	}