Re: [PATCH V3 2/6] PM / OPP: Rename opp init/free table routines

2015-09-06 Thread Shawn Guo
On Fri, Sep 04, 2015 at 01:47:23PM +0530, Viresh Kumar wrote:
> free-table routines are opposite of init-table ones, and must be named
> to make that clear. Opposite of 'init' is 'exit', but those doesn't suit
> really well.
> 
> Replace 'init' with 'add' and 'free' with 'remove'.
> 
> Reported-by: Pavel Machek 
> Reviewed-by: Stephen Boyd 
> Signed-off-by: Viresh Kumar 
> ---
>  arch/arm/mach-imx/mach-imx6q.c   |  2 +-
...
>  drivers/cpufreq/imx6q-cpufreq.c  |  6 +++---

Acked-by: Shawn Guo 
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH V3 2/6] PM / OPP: Rename opp init/free table routines

2015-09-04 Thread Viresh Kumar
free-table routines are opposite of init-table ones, and must be named
to make that clear. Opposite of 'init' is 'exit', but those doesn't suit
really well.

Replace 'init' with 'add' and 'free' with 'remove'.

Reported-by: Pavel Machek 
Reviewed-by: Stephen Boyd 
Signed-off-by: Viresh Kumar 
---
 arch/arm/mach-imx/mach-imx6q.c   |  2 +-
 drivers/base/power/opp.c | 41 ++--
 drivers/cpufreq/arm_big_little.h |  2 +-
 drivers/cpufreq/arm_big_little_dt.c  |  4 ++--
 drivers/cpufreq/cpufreq-dt.c |  6 +++---
 drivers/cpufreq/exynos5440-cpufreq.c |  6 +++---
 drivers/cpufreq/imx6q-cpufreq.c  |  6 +++---
 drivers/cpufreq/mt8173-cpufreq.c |  6 +++---
 include/linux/pm_opp.h   | 16 +++---
 9 files changed, 44 insertions(+), 45 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 9602cc12d2f1..3286eec91d92 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -350,7 +350,7 @@ static void __init imx6q_opp_init(void)
return;
}
 
-   if (of_init_opp_table(cpu_dev)) {
+   if (of_add_opp_table(cpu_dev)) {
pr_warn("failed to init OPP table\n");
goto put_node;
}
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 4741fdc13e83..1515c05bc579 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -800,8 +800,8 @@ static int _opp_add(struct device *dev, struct dev_pm_opp 
*new_opp,
  * The opp is made available by default and it can be controlled using
  * dev_pm_opp_enable/disable functions and may be removed by dev_pm_opp_remove.
  *
- * NOTE: "dynamic" parameter impacts OPPs added by the of_init_opp_table and
- * freed by of_free_opp_table.
+ * NOTE: "dynamic" parameter impacts OPPs added by the of_add_opp_table and
+ * freed by of_remove_opp_table.
  *
  * Locking: The internal device_opp and opp structures are RCU protected.
  * Hence this function internally uses RCU updater strategy with mutex locks
@@ -1185,7 +1185,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_notifier);
 
 #ifdef CONFIG_OF
 /**
- * of_free_opp_table() - Free OPP table entries created from static DT entries
+ * of_remove_opp_table() - Free OPP table entries created from static DT 
entries
  * @dev:   device pointer used to lookup device OPPs.
  *
  * Free OPPs created using static entries present in DT.
@@ -1196,7 +1196,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_notifier);
  * that this function is *NOT* called under RCU protection or in contexts where
  * mutex cannot be locked.
  */
-void of_free_opp_table(struct device *dev)
+void of_remove_opp_table(struct device *dev)
 {
struct device_opp *dev_opp;
struct dev_pm_opp *opp, *tmp;
@@ -1231,9 +1231,9 @@ void of_free_opp_table(struct device *dev)
 unlock:
mutex_unlock(_opp_list_lock);
 }
-EXPORT_SYMBOL_GPL(of_free_opp_table);
+EXPORT_SYMBOL_GPL(of_remove_opp_table);
 
-void of_cpumask_free_opp_table(cpumask_var_t cpumask)
+void of_cpumask_remove_opp_table(cpumask_var_t cpumask)
 {
struct device *cpu_dev;
int cpu;
@@ -1248,10 +1248,10 @@ void of_cpumask_free_opp_table(cpumask_var_t cpumask)
continue;
}
 
-   of_free_opp_table(cpu_dev);
+   of_remove_opp_table(cpu_dev);
}
 }
-EXPORT_SYMBOL_GPL(of_cpumask_free_opp_table);
+EXPORT_SYMBOL_GPL(of_cpumask_remove_opp_table);
 
 /* Returns opp descriptor node for a device, caller must do of_node_put() */
 static struct device_node *_of_get_opp_desc_node(struct device *dev)
@@ -1267,8 +1267,7 @@ static struct device_node *_of_get_opp_desc_node(struct 
device *dev)
 }
 
 /* Initializes OPP tables based on new bindings */
-static int _of_init_opp_table_v2(struct device *dev,
-struct device_node *opp_np)
+static int _of_add_opp_table_v2(struct device *dev, struct device_node *opp_np)
 {
struct device_node *np;
struct device_opp *dev_opp;
@@ -1310,13 +1309,13 @@ static int _of_init_opp_table_v2(struct device *dev,
return 0;
 
 free_table:
-   of_free_opp_table(dev);
+   of_remove_opp_table(dev);
 
return ret;
 }
 
 /* Initializes OPP tables based on old-deprecated bindings */
-static int _of_init_opp_table_v1(struct device *dev)
+static int _of_add_opp_table_v1(struct device *dev)
 {
const struct property *prop;
const __be32 *val;
@@ -1353,7 +1352,7 @@ static int _of_init_opp_table_v1(struct device *dev)
 }
 
 /**
- * of_init_opp_table() - Initialize opp table from device tree
+ * of_add_opp_table() - Initialize opp table from device tree
  * @dev:   device pointer used to lookup device OPPs.
  *
  * Register the initial OPP table with the OPP library for given device.
@@ -1375,7 +1374,7 @@ static int _of_init_opp_table_v1(struct device *dev)
  *