Skip to contentSkip to conversation

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

PATCH Applied Anson Huang 2 participants 2 messages Mar 17, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: imx6q-cpufreq: Improve the logic of -EPROBE_DEFER handling

Improve the -EPROBE_DEFER handling logic to simplify the code.

---
 drivers/cpufreq/imx6q-cpufreq.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/cpufreq/imx6q-cpufreq.c +3 -5
index 285b8e9..fdb2fff 100644
@@ -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;
 	}
 
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw
Quoted 15 lines · Anson Huang

Improve the -EPROBE_DEFER handling logic to simplify the code.

---
 drivers/cpufreq/imx6q-cpufreq.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/cpufreq/imx6q-cpufreq.c +0 -0
index 285b8e9..fdb2fff 100644
@@ -400,11 +400,9 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
 		ret = imx6q_opp_check_speed_grading(cpu_dev);
 	}
 	if (ret) {

drivers/cpufreq/imx6q-cpufreq.c static int imx6q_cpufreq_probe(struct platform_device *pdev) · line 407

Quoted 10 lines
drivers/cpufreq/imx6q-cpufreq.c +3 -5
-		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.

Signature · 1 line
viresh