cpufreq: imx6q: remove unused code
Subsystems (2)
PATCH 1/2 cpufreq: imx6q: remove unused code
In voltage scale down path, the return value is NOT used at all, remove them to simplify the code.
--- drivers/cpufreq/imx6q-cpufreq.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/cpufreq/imx6q-cpufreq.c +3 -9
@@ -177,22 +177,16 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index)/* scaling down? scale voltage after frequency */ if (new_freq < old_freq) { ret =regulator_set_voltage_tol (arm_reg, volt,0 ); -if (ret) { +if (ret)dev_warn (cpu_dev,"failed to scale vddarm down: %d\n" , ret); - ret =0 ; - } ret =regulator_set_voltage_tol (soc_reg, imx6_soc_volt[index],0 ); -if (ret) { +if (ret)dev_warn (cpu_dev,"failed to scale vddsoc down: %d\n" , ret); - ret =0 ; - }if (!IS_ERR (pu_reg)) { ret =regulator_set_voltage_tol (pu_reg, imx6_soc_volt[index],0 ); -if (ret) { +if (ret)dev_warn (cpu_dev,"failed to scale vddpu down: %d\n" , ret); - ret =0 ; - } } }
Signature · 1 line
2.7.4
PATCH 2/2 cpufreq: imx6q: save one condition block for normal case of nvmem read
Put return value checks of calling imx6ul_opp_check_speed_grading() into one block to save one condition block for normal case.
--- drivers/cpufreq/imx6q-cpufreq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/cpufreq/imx6q-cpufreq.c +3 -2
@@ -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;
Signature · 1 line
2.7.4
Quoted 28 lines · Anson Huang
In voltage scale down path, the return value is NOT used at all, remove them to simplify the code.
Signed-off-by Anson Huang <[email protected]>--- drivers/cpufreq/imx6q-cpufreq.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)drivers/cpufreq/imx6q-cpufreq.c +2
-6@@ -177,22 +177,16 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index)/* scaling down? scale voltage after frequency */ if (new_freq < old_freq) { ret =regulator_set_voltage_tol (arm_reg, volt,0 ); -if (ret) { +if (ret)dev_warn (cpu_dev,"failed to scale vddarm down: %d\n" , ret); - ret =0 ; - } ret =regulator_set_voltage_tol (soc_reg, imx6_soc_volt[index],0 ); -if (ret) { +if (ret)dev_warn (cpu_dev,"failed to scale vddsoc down: %d\n" , ret); - ret =0 ; - }
drivers/cpufreq/imx6q-cpufreq.c static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) · line 192
Quoted 10 lines
drivers/cpufreq/imx6q-cpufreq.c +1
-3if (!IS_ERR (pu_reg)) { ret =regulator_set_voltage_tol (pu_reg, imx6_soc_volt[index],0 ); -if (ret) { +if (ret)dev_warn (cpu_dev,"failed to scale vddpu down: %d\n" , ret); - ret =0 ; - } } }
Signature · 1 line
viresh
Re: [PATCH 2/2] cpufreq: imx6q: save one condition block for normal case of nvmem read
In reply to Anson HuangQuoted 15 lines · Anson Huang
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 <[email protected]>--- drivers/cpufreq/imx6q-cpufreq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/cpufreq/imx6q-cpufreq.c +0
-0@@ -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" )) {
drivers/cpufreq/imx6q-cpufreq.c static int imx6q_cpufreq_probe(struct platform_device *pdev) · line 414
Quoted 10 lines
drivers/cpufreq/imx6q-cpufreq.c +3
-2ret =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;
Signature · 1 line
viresh
Quoted 29 lines · CET Anson Huang
In voltage scale down path, the return value is NOT used at all, remove them to simplify the code.
Signed-off-by Anson Huang <[email protected]>--- drivers/cpufreq/imx6q-cpufreq.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)drivers/cpufreq/imx6q-cpufreq.c +2
-6@@ -177,22 +177,16 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index)/* scaling down? scale voltage after frequency */ if (new_freq < old_freq) { ret =regulator_set_voltage_tol (arm_reg, volt,0 ); -if (ret) { +if (ret)dev_warn (cpu_dev,"failed to scale vddarm down: %d\n" , ret); - ret =0 ; - } ret =regulator_set_voltage_tol (soc_reg, imx6_soc_volt[index],0 ); -if (ret) { +if (ret)dev_warn (cpu_dev,"failed to scale vddsoc down: %d\n" , ret); - ret =0 ; - }
drivers/cpufreq/imx6q-cpufreq.c static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) · line 192
Quoted 10 lines
drivers/cpufreq/imx6q-cpufreq.c +1
-3if (!IS_ERR (pu_reg)) { ret =regulator_set_voltage_tol (pu_reg, imx6_soc_volt[index],0 ); -if (ret) { +if (ret)dev_warn (cpu_dev,"failed to scale vddpu down: %d\n" , ret); - ret =0 ; - } } }
Both this one and the [2/2] applied with ACKs from Viresh.
Thanks!