diff options
author | Thierry Reding <treding@nvidia.com> | 2016-04-08 16:16:28 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2016-04-28 13:41:54 +0300 |
commit | f7c42d98621739d416cc4a739b721574fcbe910c (patch) | |
tree | cbd6f61c1a1b90780e63e7be5c3c4d3bd0988b5e /drivers/clk/tegra/cvb.c | |
parent | e8f6a68c508b5d1cc4612ada028d87c74ab279d5 (diff) | |
download | linux-f7c42d98621739d416cc4a739b721574fcbe910c.tar.xz |
clk: tegra: dfll: Properly clean up on failure and removal
Upon failure to probe the DFLL, the OPP table will not be cleaned up
properly. Fix this and while at it make sure the OPP table will also be
cleared upon driver removal.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/clk/tegra/cvb.c')
-rw-r--r-- | drivers/clk/tegra/cvb.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/clk/tegra/cvb.c b/drivers/clk/tegra/cvb.c index 7a099b18c368..624115e82ff9 100644 --- a/drivers/clk/tegra/cvb.c +++ b/drivers/clk/tegra/cvb.c @@ -130,3 +130,19 @@ tegra_cvb_add_opp_table(struct device *dev, const struct cvb_table *tables, return ERR_PTR(-EINVAL); } + +void tegra_cvb_remove_opp_table(struct device *dev, + const struct cvb_table *table, + unsigned long max_freq) +{ + unsigned int i; + + for (i = 0; i < MAX_DVFS_FREQS; i++) { + const struct cvb_table_freq_entry *entry = &table->entries[i]; + + if (!entry->freq || (entry->freq > max_freq)) + break; + + dev_pm_opp_remove(dev, entry->freq); + } +} |