aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-09-04 04:17:23 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-09-14 20:03:15 -0400
commitf0489a5ef4d011e29f78021ad13a543e8769d619 (patch)
treeae78bd2d07cd07cfd34def48f2390dad0d7db7c7 /drivers/base
parent1840995c52d44bec8c20d6c07a706dc1499da9da (diff)
PM / OPP: Rename opp init/free table routines
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 <pavel@ucw.cz> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/opp.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index c3a738652d13..9f0a2929821b 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -828,8 +828,8 @@ static int _opp_add(struct device *dev, struct dev_pm_opp *new_opp,
828 * The opp is made available by default and it can be controlled using 828 * The opp is made available by default and it can be controlled using
829 * dev_pm_opp_enable/disable functions and may be removed by dev_pm_opp_remove. 829 * dev_pm_opp_enable/disable functions and may be removed by dev_pm_opp_remove.
830 * 830 *
831 * NOTE: "dynamic" parameter impacts OPPs added by the of_init_opp_table and 831 * NOTE: "dynamic" parameter impacts OPPs added by the of_add_opp_table and
832 * freed by of_free_opp_table. 832 * freed by of_remove_opp_table.
833 * 833 *
834 * Locking: The internal device_opp and opp structures are RCU protected. 834 * Locking: The internal device_opp and opp structures are RCU protected.
835 * Hence this function internally uses RCU updater strategy with mutex locks 835 * Hence this function internally uses RCU updater strategy with mutex locks
@@ -1213,7 +1213,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_notifier);
1213 1213
1214#ifdef CONFIG_OF 1214#ifdef CONFIG_OF
1215/** 1215/**
1216 * of_free_opp_table() - Free OPP table entries created from static DT entries 1216 * of_remove_opp_table() - Free OPP table entries created from static DT entries
1217 * @dev: device pointer used to lookup device OPPs. 1217 * @dev: device pointer used to lookup device OPPs.
1218 * 1218 *
1219 * Free OPPs created using static entries present in DT. 1219 * Free OPPs created using static entries present in DT.
@@ -1224,7 +1224,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_notifier);
1224 * that this function is *NOT* called under RCU protection or in contexts where 1224 * that this function is *NOT* called under RCU protection or in contexts where
1225 * mutex cannot be locked. 1225 * mutex cannot be locked.
1226 */ 1226 */
1227void of_free_opp_table(struct device *dev) 1227void of_remove_opp_table(struct device *dev)
1228{ 1228{
1229 struct device_opp *dev_opp; 1229 struct device_opp *dev_opp;
1230 struct dev_pm_opp *opp, *tmp; 1230 struct dev_pm_opp *opp, *tmp;
@@ -1259,9 +1259,9 @@ void of_free_opp_table(struct device *dev)
1259unlock: 1259unlock:
1260 mutex_unlock(&dev_opp_list_lock); 1260 mutex_unlock(&dev_opp_list_lock);
1261} 1261}
1262EXPORT_SYMBOL_GPL(of_free_opp_table); 1262EXPORT_SYMBOL_GPL(of_remove_opp_table);
1263 1263
1264void of_cpumask_free_opp_table(cpumask_var_t cpumask) 1264void of_cpumask_remove_opp_table(cpumask_var_t cpumask)
1265{ 1265{
1266 struct device *cpu_dev; 1266 struct device *cpu_dev;
1267 int cpu; 1267 int cpu;
@@ -1276,10 +1276,10 @@ void of_cpumask_free_opp_table(cpumask_var_t cpumask)
1276 continue; 1276 continue;
1277 } 1277 }
1278 1278
1279 of_free_opp_table(cpu_dev); 1279 of_remove_opp_table(cpu_dev);
1280 } 1280 }
1281} 1281}
1282EXPORT_SYMBOL_GPL(of_cpumask_free_opp_table); 1282EXPORT_SYMBOL_GPL(of_cpumask_remove_opp_table);
1283 1283
1284/* Returns opp descriptor node for a device, caller must do of_node_put() */ 1284/* Returns opp descriptor node for a device, caller must do of_node_put() */
1285static struct device_node *_of_get_opp_desc_node(struct device *dev) 1285static struct device_node *_of_get_opp_desc_node(struct device *dev)
@@ -1295,8 +1295,7 @@ static struct device_node *_of_get_opp_desc_node(struct device *dev)
1295} 1295}
1296 1296
1297/* Initializes OPP tables based on new bindings */ 1297/* Initializes OPP tables based on new bindings */
1298static int _of_init_opp_table_v2(struct device *dev, 1298static int _of_add_opp_table_v2(struct device *dev, struct device_node *opp_np)
1299 struct device_node *opp_np)
1300{ 1299{
1301 struct device_node *np; 1300 struct device_node *np;
1302 struct device_opp *dev_opp; 1301 struct device_opp *dev_opp;
@@ -1338,13 +1337,13 @@ static int _of_init_opp_table_v2(struct device *dev,
1338 return 0; 1337 return 0;
1339 1338
1340free_table: 1339free_table:
1341 of_free_opp_table(dev); 1340 of_remove_opp_table(dev);
1342 1341
1343 return ret; 1342 return ret;
1344} 1343}
1345 1344
1346/* Initializes OPP tables based on old-deprecated bindings */ 1345/* Initializes OPP tables based on old-deprecated bindings */
1347static int _of_init_opp_table_v1(struct device *dev) 1346static int _of_add_opp_table_v1(struct device *dev)
1348{ 1347{
1349 const struct property *prop; 1348 const struct property *prop;
1350 const __be32 *val; 1349 const __be32 *val;
@@ -1381,7 +1380,7 @@ static int _of_init_opp_table_v1(struct device *dev)
1381} 1380}
1382 1381
1383/** 1382/**
1384 * of_init_opp_table() - Initialize opp table from device tree 1383 * of_add_opp_table() - Initialize opp table from device tree
1385 * @dev: device pointer used to lookup device OPPs. 1384 * @dev: device pointer used to lookup device OPPs.
1386 * 1385 *
1387 * Register the initial OPP table with the OPP library for given device. 1386 * Register the initial OPP table with the OPP library for given device.
@@ -1403,7 +1402,7 @@ static int _of_init_opp_table_v1(struct device *dev)
1403 * -ENODATA when empty 'operating-points' property is found 1402 * -ENODATA when empty 'operating-points' property is found
1404 * -EINVAL when invalid entries are found in opp-v2 table 1403 * -EINVAL when invalid entries are found in opp-v2 table
1405 */ 1404 */
1406int of_init_opp_table(struct device *dev) 1405int of_add_opp_table(struct device *dev)
1407{ 1406{
1408 struct device_node *opp_np; 1407 struct device_node *opp_np;
1409 int ret; 1408 int ret;
@@ -1418,17 +1417,17 @@ int of_init_opp_table(struct device *dev)
1418 * Try old-deprecated bindings for backward compatibility with 1417 * Try old-deprecated bindings for backward compatibility with
1419 * older dtbs. 1418 * older dtbs.
1420 */ 1419 */
1421 return _of_init_opp_table_v1(dev); 1420 return _of_add_opp_table_v1(dev);
1422 } 1421 }
1423 1422
1424 ret = _of_init_opp_table_v2(dev, opp_np); 1423 ret = _of_add_opp_table_v2(dev, opp_np);
1425 of_node_put(opp_np); 1424 of_node_put(opp_np);
1426 1425
1427 return ret; 1426 return ret;
1428} 1427}
1429EXPORT_SYMBOL_GPL(of_init_opp_table); 1428EXPORT_SYMBOL_GPL(of_add_opp_table);
1430 1429
1431int of_cpumask_init_opp_table(cpumask_var_t cpumask) 1430int of_cpumask_add_opp_table(cpumask_var_t cpumask)
1432{ 1431{
1433 struct device *cpu_dev; 1432 struct device *cpu_dev;
1434 int cpu, ret = 0; 1433 int cpu, ret = 0;
@@ -1443,20 +1442,20 @@ int of_cpumask_init_opp_table(cpumask_var_t cpumask)
1443 continue; 1442 continue;
1444 } 1443 }
1445 1444
1446 ret = of_init_opp_table(cpu_dev); 1445 ret = of_add_opp_table(cpu_dev);
1447 if (ret) { 1446 if (ret) {
1448 pr_err("%s: couldn't find opp table for cpu:%d, %d\n", 1447 pr_err("%s: couldn't find opp table for cpu:%d, %d\n",
1449 __func__, cpu, ret); 1448 __func__, cpu, ret);
1450 1449
1451 /* Free all other OPPs */ 1450 /* Free all other OPPs */
1452 of_cpumask_free_opp_table(cpumask); 1451 of_cpumask_remove_opp_table(cpumask);
1453 break; 1452 break;
1454 } 1453 }
1455 } 1454 }
1456 1455
1457 return ret; 1456 return ret;
1458} 1457}
1459EXPORT_SYMBOL_GPL(of_cpumask_init_opp_table); 1458EXPORT_SYMBOL_GPL(of_cpumask_add_opp_table);
1460 1459
1461/* Required only for V1 bindings, as v2 can manage it from DT itself */ 1460/* Required only for V1 bindings, as v2 can manage it from DT itself */
1462int set_cpus_sharing_opps(struct device *cpu_dev, cpumask_var_t cpumask) 1461int set_cpus_sharing_opps(struct device *cpu_dev, cpumask_var_t cpumask)