aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/unittest.c
diff options
context:
space:
mode:
authorFrank Rowand <frank.rowand@sony.com>2017-10-17 19:36:23 -0400
committerRob Herring <robh@kernel.org>2017-10-17 21:46:17 -0400
commit0290c4ca2536a35e55c53cfb9058465b1f987b17 (patch)
tree310203536e1dafb5cf6c0b8287e2ed83de0876ec /drivers/of/unittest.c
parentbbed8794d53b7043d7989e22bc2e1e399da305eb (diff)
of: overlay: rename identifiers to more reflect what they do
This patch is aimed primarily at drivers/of/overlay.c, but those changes also have a small impact in a few other files. overlay.c is difficult to read and maintain. Improve readability: - Rename functions, types and variables to better reflect what they do and to be consistent with names in other places, such as the device tree overlay FDT (flattened device tree), and make the algorithms more clear - Use the same names consistently throughout the file - Update comments for name changes - Fix incorrect comments This patch is intended to not introduce any functional change. Signed-off-by: Frank Rowand <frank.rowand@sony.com> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/unittest.c')
-rw-r--r--drivers/of/unittest.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index add02cfbfb88..bbdaf5606820 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -1230,7 +1230,7 @@ static void of_unittest_destroy_tracked_overlays(void)
1230 if (!(overlay_id_bits[BIT_WORD(id)] & BIT_MASK(id))) 1230 if (!(overlay_id_bits[BIT_WORD(id)] & BIT_MASK(id)))
1231 continue; 1231 continue;
1232 1232
1233 ret = of_overlay_destroy(id + overlay_first_id); 1233 ret = of_overlay_remove(id + overlay_first_id);
1234 if (ret == -ENODEV) { 1234 if (ret == -ENODEV) {
1235 pr_warn("%s: no overlay to destroy for #%d\n", 1235 pr_warn("%s: no overlay to destroy for #%d\n",
1236 __func__, id + overlay_first_id); 1236 __func__, id + overlay_first_id);
@@ -1262,7 +1262,7 @@ static int of_unittest_apply_overlay(int overlay_nr, int unittest_nr,
1262 goto out; 1262 goto out;
1263 } 1263 }
1264 1264
1265 ret = of_overlay_create(np); 1265 ret = of_overlay_apply(np);
1266 if (ret < 0) { 1266 if (ret < 0) {
1267 unittest(0, "could not create overlay from \"%s\"\n", 1267 unittest(0, "could not create overlay from \"%s\"\n",
1268 overlay_path(overlay_nr)); 1268 overlay_path(overlay_nr));
@@ -1347,7 +1347,7 @@ static int of_unittest_apply_revert_overlay_check(int overlay_nr,
1347 return -EINVAL; 1347 return -EINVAL;
1348 } 1348 }
1349 1349
1350 ret = of_overlay_destroy(ov_id); 1350 ret = of_overlay_remove(ov_id);
1351 if (ret != 0) { 1351 if (ret != 0) {
1352 unittest(0, "overlay @\"%s\" failed to be destroyed @\"%s\"\n", 1352 unittest(0, "overlay @\"%s\" failed to be destroyed @\"%s\"\n",
1353 overlay_path(overlay_nr), 1353 overlay_path(overlay_nr),
@@ -1476,7 +1476,7 @@ static void of_unittest_overlay_6(void)
1476 return; 1476 return;
1477 } 1477 }
1478 1478
1479 ret = of_overlay_create(np); 1479 ret = of_overlay_apply(np);
1480 if (ret < 0) { 1480 if (ret < 0) {
1481 unittest(0, "could not create overlay from \"%s\"\n", 1481 unittest(0, "could not create overlay from \"%s\"\n",
1482 overlay_path(overlay_nr + i)); 1482 overlay_path(overlay_nr + i));
@@ -1500,7 +1500,7 @@ static void of_unittest_overlay_6(void)
1500 } 1500 }
1501 1501
1502 for (i = 1; i >= 0; i--) { 1502 for (i = 1; i >= 0; i--) {
1503 ret = of_overlay_destroy(ov_id[i]); 1503 ret = of_overlay_remove(ov_id[i]);
1504 if (ret != 0) { 1504 if (ret != 0) {
1505 unittest(0, "overlay @\"%s\" failed destroy @\"%s\"\n", 1505 unittest(0, "overlay @\"%s\" failed destroy @\"%s\"\n",
1506 overlay_path(overlay_nr + i), 1506 overlay_path(overlay_nr + i),
@@ -1546,7 +1546,7 @@ static void of_unittest_overlay_8(void)
1546 return; 1546 return;
1547 } 1547 }
1548 1548
1549 ret = of_overlay_create(np); 1549 ret = of_overlay_apply(np);
1550 if (ret < 0) { 1550 if (ret < 0) {
1551 unittest(0, "could not create overlay from \"%s\"\n", 1551 unittest(0, "could not create overlay from \"%s\"\n",
1552 overlay_path(overlay_nr + i)); 1552 overlay_path(overlay_nr + i));
@@ -1557,7 +1557,7 @@ static void of_unittest_overlay_8(void)
1557 } 1557 }
1558 1558
1559 /* now try to remove first overlay (it should fail) */ 1559 /* now try to remove first overlay (it should fail) */
1560 ret = of_overlay_destroy(ov_id[0]); 1560 ret = of_overlay_remove(ov_id[0]);
1561 if (ret == 0) { 1561 if (ret == 0) {
1562 unittest(0, "overlay @\"%s\" was destroyed @\"%s\"\n", 1562 unittest(0, "overlay @\"%s\" was destroyed @\"%s\"\n",
1563 overlay_path(overlay_nr + 0), 1563 overlay_path(overlay_nr + 0),
@@ -1568,7 +1568,7 @@ static void of_unittest_overlay_8(void)
1568 1568
1569 /* removing them in order should work */ 1569 /* removing them in order should work */
1570 for (i = 1; i >= 0; i--) { 1570 for (i = 1; i >= 0; i--) {
1571 ret = of_overlay_destroy(ov_id[i]); 1571 ret = of_overlay_remove(ov_id[i]);
1572 if (ret != 0) { 1572 if (ret != 0) {
1573 unittest(0, "overlay @\"%s\" not destroyed @\"%s\"\n", 1573 unittest(0, "overlay @\"%s\" not destroyed @\"%s\"\n",
1574 overlay_path(overlay_nr + i), 1574 overlay_path(overlay_nr + i),
@@ -2149,9 +2149,9 @@ static int __init overlay_data_add(int onum)
2149 goto out_free_np_overlay; 2149 goto out_free_np_overlay;
2150 } 2150 }
2151 2151
2152 ret = of_overlay_create(info->np_overlay); 2152 ret = of_overlay_apply(info->np_overlay);
2153 if (ret < 0) { 2153 if (ret < 0) {
2154 pr_err("of_overlay_create() (ret=%d), %d\n", ret, onum); 2154 pr_err("of_overlay_apply() (ret=%d), %d\n", ret, onum);
2155 goto out_free_np_overlay; 2155 goto out_free_np_overlay;
2156 } else { 2156 } else {
2157 info->overlay_id = ret; 2157 info->overlay_id = ret;