cpufreq: dt: dev_pm_opp_put_regulators() accepts NULL argument
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 6 Nov 2020 06:48:39 +0000 (12:18 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Wed, 9 Dec 2020 05:51:11 +0000 (11:21 +0530)
The dev_pm_opp_put_*() APIs now accepts a NULL opp_table pointer and so
there is no need for us to carry the extra checks. Drop them.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/cpufreq-dt.c

index 5aa3d4e3140d940b12d4d4af81dcad1f139eabbd..ad4234518ef64c72f8c4c6491ff9eedd2ee8ef3a 100644 (file)
@@ -291,8 +291,7 @@ static int dt_cpufreq_early_init(struct device *dev, int cpu)
 out:
        if (priv->have_static_opps)
                dev_pm_opp_of_cpumask_remove_table(priv->cpus);
-       if (priv->opp_table)
-               dev_pm_opp_put_regulators(priv->opp_table);
+       dev_pm_opp_put_regulators(priv->opp_table);
 free_cpumask:
        free_cpumask_var(priv->cpus);
        return ret;
@@ -306,8 +305,7 @@ static void dt_cpufreq_release(void)
                dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &priv->freq_table);
                if (priv->have_static_opps)
                        dev_pm_opp_of_cpumask_remove_table(priv->cpus);
-               if (priv->opp_table)
-                       dev_pm_opp_put_regulators(priv->opp_table);
+               dev_pm_opp_put_regulators(priv->opp_table);
                free_cpumask_var(priv->cpus);
                list_del(&priv->node);
        }