From 99f381d3549432a250fe846a2a82d61a032804b0 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 10 Jun 2011 20:24:57 +0200 Subject: 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 Acked-by: Kevin Hilman Signed-off-by: Rafael J. Wysocki --- drivers/base/power/opp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'drivers/base/power') 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, return 0; } + +/** + * opp_free_cpufreq_table() - free the cpufreq table + * @dev: device for which we do this operation + * @table: table to free + * + * Free up the table allocated by opp_init_cpufreq_table + */ +void opp_free_cpufreq_table(struct device *dev, + struct cpufreq_frequency_table **table) +{ + if (!table) + return; + + kfree(*table); + *table = NULL; +} #endif /* CONFIG_CPU_FREQ */ -- cgit v1.2.3