PM / devfreq: tegra30: convert to use devm_pm_opp_* API
Subsystems (9)
PATCH 26/31 PM / devfreq: tegra30: convert to use devm_pm_opp_* API
Use devm_pm_opp_* API to simplify code, and remove opp_table from tegra_devfreq.
--- drivers/devfreq/tegra30-devfreq.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-)
drivers/devfreq/tegra30-devfreq.c +7 -14
@@ -178,7 +178,6 @@ struct tegra_devfreq_soc_data {struct tegra_devfreq {struct devfreq *devfreq; -struct opp_table *opp_table;struct reset_control *reset;struct clk *clock;
@@ -794,6 +793,7 @@ static int tegra_devfreq_probe(struct platform_device *pdev)struct tegra_devfreq_device *dev;struct tegra_devfreq *tegra;struct devfreq *devfreq; +struct opp_tabl *opp_table;unsigned int i;long rate;int err;
@@ -841,25 +841,25 @@ static int tegra_devfreq_probe(struct platform_device *pdev)return err; } - tegra->opp_table =dev_pm_opp_set_supported_hw (&pdev->dev, - &hw_version,1 ); - err =PTR_ERR_OR_ZERO (tegra->opp_table); + opp_table =devm_pm_opp_set_supported_hw (&pdev->dev, + &hw_version,1 ); + err =PTR_ERR_OR_ZERO (opp_table);if (err) {dev_err (&pdev->dev,"Failed to set supported HW: %d\n" , err);return err; } - err =dev_pm_opp_of_add_table (&pdev->dev); + err =devm_pm_opp_of_add_table (&pdev->dev);if (err) {dev_err (&pdev->dev,"Failed to add OPP table: %d\n" , err); - goto put_hw; +return err; } err =clk_prepare_enable (tegra->clock);if (err) {dev_err (&pdev->dev,"Failed to prepare and enable ACTMON clock\n" ); - goto remove_table; +return err; } err =reset_control_reset (tegra->reset);
@@ -917,10 +917,6 @@ static int tegra_devfreq_probe(struct platform_device *pdev)reset_control_reset (tegra->reset); disable_clk:clk_disable_unprepare (tegra->clock); -remove_table: -dev_pm_opp_of_remove_table (&pdev->dev); -put_hw: -dev_pm_opp_put_supported_hw (tegra->opp_table);return err; }
@@ -935,9 +931,6 @@ static int tegra_devfreq_remove(struct platform_device *pdev)reset_control_reset (tegra->reset);clk_disable_unprepare (tegra->clock); -dev_pm_opp_of_remove_table (&pdev->dev); -dev_pm_opp_put_supported_hw (tegra->opp_table); -return 0 ; }
Signature · 1 line
2.25.1
Quoted 2 lines · Yangtao Li
Use devm_pm_opp_* API to simplify code, and remove
opp_tablefromtegra_devfreq.
Patches starting this one didn't appear in the same thread and it is a nightmare to apply these now. Please send everything properly next time.
Signature · 1 line
viresh
Hi,
Quoted 22 lines · Yangtao Li
Use devm_pm_opp_* API to simplify code, and remove
opp_tablefromtegra_devfreq.Signed-off-by Yangtao Li <[email protected]>--- drivers/devfreq/tegra30-devfreq.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-)drivers/devfreq/tegra30-devfreq.c +0
-1@@ -178,7 +178,6 @@ struct tegra_devfreq_soc_data {struct tegra_devfreq {struct devfreq *devfreq; -struct opp_table *opp_table;struct reset_control *reset;struct clk *clock;
drivers/devfreq/tegra30-devfreq.c static int tegra_devfreq_probe(struct platform_device *pdev) · line 796
Quoted 4 lines
drivers/devfreq/tegra30-devfreq.c +1
-0@@ -794,6 +793,7 @@ static int tegra_devfreq_probe(struct platform_device *pdev)struct tegra_devfreq_device *dev;struct tegra_devfreq *tegra;struct devfreq *devfreq; +struct opp_tabl *opp_table;
opp_tabl -> opp_table. It will make the build error. Please do build test at least.
Quoted 36 lines
drivers/devfreq/tegra30-devfreq.c +6
-6unsigned int i;long rate;int err;@@ -841,25 +841,25 @@ static int tegra_devfreq_probe(struct platform_device *pdev)return err; } - tegra->opp_table =dev_pm_opp_set_supported_hw (&pdev->dev, - &hw_version,1 ); - err =PTR_ERR_OR_ZERO (tegra->opp_table); + opp_table =devm_pm_opp_set_supported_hw (&pdev->dev, + &hw_version,1 ); + err =PTR_ERR_OR_ZERO (opp_table);if (err) {dev_err (&pdev->dev,"Failed to set supported HW: %d\n" , err);return err; } - err =dev_pm_opp_of_add_table (&pdev->dev); + err =devm_pm_opp_of_add_table (&pdev->dev);if (err) {dev_err (&pdev->dev,"Failed to add OPP table: %d\n" , err); - goto put_hw; +return err; } err =clk_prepare_enable (tegra->clock);if (err) {dev_err (&pdev->dev,"Failed to prepare and enable ACTMON clock\n" ); - goto remove_table; +return err; } err =reset_control_reset (tegra->reset);
drivers/devfreq/tegra30-devfreq.c static int tegra_devfreq_probe(struct platform_device *pdev) · line 923
Quoted 7 lines
drivers/devfreq/tegra30-devfreq.c +0
-4@@ -917,10 +917,6 @@ static int tegra_devfreq_probe(struct platform_device *pdev)reset_control_reset (tegra->reset); disable_clk:clk_disable_unprepare (tegra->clock); -remove_table: -dev_pm_opp_of_remove_table (&pdev->dev); -put_hw: -dev_pm_opp_put_supported_hw (tegra->opp_table);
You might remove the 'devm_pm_opp_remove_all_dynamic(&pdev->dev) under ' remove_opp' goto statement.kkkk
(snip)
Signature · 6 lines
Best Regards, Chanwoo Choi _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Dmitry Osipenko
maintainer05.01.2021 06:47, Chanwoo Choi пишет:
Quoted 2 lines
You might remove the '
devm_pm_opp_remove_all_dynamic(&pdev->dev)under 'remove_opp' goto statement.kkkk
Good catch, thank you.