aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2011-06-10 14:24:57 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-07-15 17:58:18 -0400
commit99f381d3549432a250fe846a2a82d61a032804b0 (patch)
treec267e27c99d0609732e54fb7e7fda9fef2a7e8c0 /drivers/base
parent3110df800c4de2724624d46e6bed27efc5e9a707 (diff)
PM / OPP: Introduce function to free cpufreq table
cpufreq table allocated by opp_init_cpufreq_table is better freed by OPP layer itself. This allows future modifications to the table handling to be transparent to the users. Signed-off-by: Nishanth Menon <nm@ti.com> Acked-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/opp.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 56a6899f5e9e..5cc12322ef32 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -625,4 +625,21 @@ int opp_init_cpufreq_table(struct device *dev,
625 625
626 return 0; 626 return 0;
627} 627}
628
629/**
630 * opp_free_cpufreq_table() - free the cpufreq table
631 * @dev: device for which we do this operation
632 * @table: table to free
633 *
634 * Free up the table allocated by opp_init_cpufreq_table
635 */
636void opp_free_cpufreq_table(struct device *dev,
637 struct cpufreq_frequency_table **table)
638{
639 if (!table)
640 return;
641
642 kfree(*table);
643 *table = NULL;
644}
628#endif /* CONFIG_CPU_FREQ */ 645#endif /* CONFIG_CPU_FREQ */