Loading drivers/cpufreq/imx6q-cpufreq.c +2 −8 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ static struct clk_bulk_data clks[] = { }; static struct device *cpu_dev; static bool free_opp; static struct cpufreq_frequency_table *freq_table; static unsigned int max_freq; static unsigned int transition_latency; Loading Loading @@ -390,9 +389,6 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) goto put_reg; } /* Because we have added the OPPs here, we must free them */ free_opp = true; if (of_machine_is_compatible("fsl,imx6ul") || of_machine_is_compatible("fsl,imx6ull")) { ret = imx6ul_opp_check_speed_grading(cpu_dev); Loading Loading @@ -507,7 +503,6 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) free_freq_table: dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); out_free_opp: if (free_opp) dev_pm_opp_of_remove_table(cpu_dev); put_reg: if (!IS_ERR(arm_reg)) Loading @@ -528,7 +523,6 @@ static int imx6q_cpufreq_remove(struct platform_device *pdev) { cpufreq_unregister_driver(&imx6q_cpufreq_driver); dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); if (free_opp) dev_pm_opp_of_remove_table(cpu_dev); regulator_put(arm_reg); if (!IS_ERR(pu_reg)) Loading drivers/opp/core.c +16 −6 Original line number Diff line number Diff line Loading @@ -1300,13 +1300,19 @@ void dev_pm_opp_remove(struct device *dev, unsigned long freq) } EXPORT_SYMBOL_GPL(dev_pm_opp_remove); void _opp_remove_all_static(struct opp_table *opp_table) bool _opp_remove_all_static(struct opp_table *opp_table) { struct dev_pm_opp *opp, *tmp; bool ret = true; mutex_lock(&opp_table->lock); if (!opp_table->parsed_static_opps || --opp_table->parsed_static_opps) if (!opp_table->parsed_static_opps) { ret = false; goto unlock; } if (--opp_table->parsed_static_opps) goto unlock; list_for_each_entry_safe(opp, tmp, &opp_table->opp_list, node) { Loading @@ -1316,6 +1322,8 @@ void _opp_remove_all_static(struct opp_table *opp_table) unlock: mutex_unlock(&opp_table->lock); return ret; } /** Loading Loading @@ -2418,12 +2426,14 @@ void _dev_pm_opp_find_and_remove_table(struct device *dev) return; } _opp_remove_all_static(opp_table); /* Drop reference taken by _find_opp_table() */ /* * Drop the extra reference only if the OPP table was successfully added * with dev_pm_opp_of_add_table() earlier. **/ if (_opp_remove_all_static(opp_table)) dev_pm_opp_put_opp_table(opp_table); /* Drop reference taken while the OPP table was added */ /* Drop reference taken by _find_opp_table() */ dev_pm_opp_put_opp_table(opp_table); } Loading drivers/opp/opp.h +1 −1 Original line number Diff line number Diff line Loading @@ -212,7 +212,7 @@ struct opp_table { /* Routines internal to opp core */ void dev_pm_opp_get(struct dev_pm_opp *opp); void _opp_remove_all_static(struct opp_table *opp_table); bool _opp_remove_all_static(struct opp_table *opp_table); void _get_opp_table_kref(struct opp_table *opp_table); int _get_opp_count(struct opp_table *opp_table); struct opp_table *_find_opp_table(struct device *dev); Loading Loading
drivers/cpufreq/imx6q-cpufreq.c +2 −8 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ static struct clk_bulk_data clks[] = { }; static struct device *cpu_dev; static bool free_opp; static struct cpufreq_frequency_table *freq_table; static unsigned int max_freq; static unsigned int transition_latency; Loading Loading @@ -390,9 +389,6 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) goto put_reg; } /* Because we have added the OPPs here, we must free them */ free_opp = true; if (of_machine_is_compatible("fsl,imx6ul") || of_machine_is_compatible("fsl,imx6ull")) { ret = imx6ul_opp_check_speed_grading(cpu_dev); Loading Loading @@ -507,7 +503,6 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) free_freq_table: dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); out_free_opp: if (free_opp) dev_pm_opp_of_remove_table(cpu_dev); put_reg: if (!IS_ERR(arm_reg)) Loading @@ -528,7 +523,6 @@ static int imx6q_cpufreq_remove(struct platform_device *pdev) { cpufreq_unregister_driver(&imx6q_cpufreq_driver); dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); if (free_opp) dev_pm_opp_of_remove_table(cpu_dev); regulator_put(arm_reg); if (!IS_ERR(pu_reg)) Loading
drivers/opp/core.c +16 −6 Original line number Diff line number Diff line Loading @@ -1300,13 +1300,19 @@ void dev_pm_opp_remove(struct device *dev, unsigned long freq) } EXPORT_SYMBOL_GPL(dev_pm_opp_remove); void _opp_remove_all_static(struct opp_table *opp_table) bool _opp_remove_all_static(struct opp_table *opp_table) { struct dev_pm_opp *opp, *tmp; bool ret = true; mutex_lock(&opp_table->lock); if (!opp_table->parsed_static_opps || --opp_table->parsed_static_opps) if (!opp_table->parsed_static_opps) { ret = false; goto unlock; } if (--opp_table->parsed_static_opps) goto unlock; list_for_each_entry_safe(opp, tmp, &opp_table->opp_list, node) { Loading @@ -1316,6 +1322,8 @@ void _opp_remove_all_static(struct opp_table *opp_table) unlock: mutex_unlock(&opp_table->lock); return ret; } /** Loading Loading @@ -2418,12 +2426,14 @@ void _dev_pm_opp_find_and_remove_table(struct device *dev) return; } _opp_remove_all_static(opp_table); /* Drop reference taken by _find_opp_table() */ /* * Drop the extra reference only if the OPP table was successfully added * with dev_pm_opp_of_add_table() earlier. **/ if (_opp_remove_all_static(opp_table)) dev_pm_opp_put_opp_table(opp_table); /* Drop reference taken while the OPP table was added */ /* Drop reference taken by _find_opp_table() */ dev_pm_opp_put_opp_table(opp_table); } Loading
drivers/opp/opp.h +1 −1 Original line number Diff line number Diff line Loading @@ -212,7 +212,7 @@ struct opp_table { /* Routines internal to opp core */ void dev_pm_opp_get(struct dev_pm_opp *opp); void _opp_remove_all_static(struct opp_table *opp_table); bool _opp_remove_all_static(struct opp_table *opp_table); void _get_opp_table_kref(struct opp_table *opp_table); int _get_opp_count(struct opp_table *opp_table); struct opp_table *_find_opp_table(struct device *dev); Loading