diff mbox series

[2/2] cpufreq: imx6q: save one condition block for normal case of nvmem read

Message ID 1543200853-10029-2-git-send-email-Anson.Huang@nxp.com (mailing list archive)
State Mainlined
Delegated to: Rafael Wysocki
Headers show
Series [1/2] cpufreq: imx6q: remove unused code | expand

Commit Message

Anson Huang Nov. 26, 2018, 2:59 a.m. UTC
Put return value checks of calling imx6ul_opp_check_speed_grading()
into one block to save one condition block for normal case.

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

Comments

Viresh Kumar Nov. 26, 2018, 6:05 a.m. UTC | #1
On 26-11-18, 02:59, Anson Huang wrote:
> Put return value checks of calling imx6ul_opp_check_speed_grading()
> into one block to save one condition block for normal case.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
>  drivers/cpufreq/imx6q-cpufreq.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
> index 8cb9683..9fedf62 100644
> --- a/drivers/cpufreq/imx6q-cpufreq.c
> +++ b/drivers/cpufreq/imx6q-cpufreq.c
> @@ -405,9 +405,10 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
>  	if (of_machine_is_compatible("fsl,imx6ul") ||
>  	    of_machine_is_compatible("fsl,imx6ull")) {
>  		ret = imx6ul_opp_check_speed_grading(cpu_dev);
> -		if (ret == -EPROBE_DEFER)
> -			return ret;
>  		if (ret) {
> +			if (ret == -EPROBE_DEFER)
> +				return ret;
> +
>  			dev_err(cpu_dev, "failed to read ocotp: %d\n",
>  				ret);
>  			return ret;

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
diff mbox series

Patch

diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
index 8cb9683..9fedf62 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -405,9 +405,10 @@  static int imx6q_cpufreq_probe(struct platform_device *pdev)
 	if (of_machine_is_compatible("fsl,imx6ul") ||
 	    of_machine_is_compatible("fsl,imx6ull")) {
 		ret = imx6ul_opp_check_speed_grading(cpu_dev);
-		if (ret == -EPROBE_DEFER)
-			return ret;
 		if (ret) {
+			if (ret == -EPROBE_DEFER)
+				return ret;
+
 			dev_err(cpu_dev, "failed to read ocotp: %d\n",
 				ret);
 			return ret;