aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/extres
diff options
context:
space:
mode:
authorOleksandr Tymoshenko <gonzo@FreeBSD.org>2018-04-09 22:06:16 +0000
committerOleksandr Tymoshenko <gonzo@FreeBSD.org>2018-04-09 22:06:16 +0000
commitf7604b1b275455fc5506c3c83a4876f567bbc6b3 (patch)
tree40a5b93b5f618e99153acf0d1ffd93ec763bce3d /sys/dev/extres
parentc7fb0e1ddf717f58e069fd2339b05370b41df3ce (diff)
downloadsrc-f7604b1b275455fc5506c3c83a4876f567bbc6b3.tar.gz
src-f7604b1b275455fc5506c3c83a4876f567bbc6b3.zip
Align OF_getencprop_alloc API with OF_getencprop and OF_getprop_alloc
Change OF_getencprop_alloc semantics to be combination of malloc and OF_getencprop and return size of the property, not number of elements allocated. For the use cases where number of elements is preferred introduce OF_getencprop_alloc_multi helper function that copies semantics of OF_getencprop_alloc prior to this change. This is to make OF_getencprop_alloc and OF_getencprop_alloc_multi function signatures consistent with OF_getencprop_alloc and OF_getencprop_alloc_multi. Functionality-wise this patch is mostly rename of OF_getencprop_alloc to OF_getencprop_alloc_multi except two calls in ofw_bus_setup_iinfo where 1 was used as a block size.
Notes
Notes: svn path=/head/; revision=332341
Diffstat (limited to 'sys/dev/extres')
-rw-r--r--sys/dev/extres/clk/clk.c2
-rw-r--r--sys/dev/extres/phy/phy.c2
-rw-r--r--sys/dev/extres/regulator/regulator.c2
-rw-r--r--sys/dev/extres/syscon/syscon.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/extres/clk/clk.c b/sys/dev/extres/clk/clk.c
index c3708a0ce275..04beaeea0cb5 100644
--- a/sys/dev/extres/clk/clk.c
+++ b/sys/dev/extres/clk/clk.c
@@ -1409,7 +1409,7 @@ clk_parse_ofw_out_names(device_t dev, phandle_t node, const char ***out_names,
if (!OF_hasprop(node, "clock-indices"))
return (name_items);
- rv = OF_getencprop_alloc(node, "clock-indices", sizeof (uint32_t),
+ rv = OF_getencprop_alloc_multi(node, "clock-indices", sizeof (uint32_t),
(void **)indices);
if (rv != name_items) {
device_printf(dev, " Size of 'clock-output-names' and "
diff --git a/sys/dev/extres/phy/phy.c b/sys/dev/extres/phy/phy.c
index b17b92744a64..35090f1832d3 100644
--- a/sys/dev/extres/phy/phy.c
+++ b/sys/dev/extres/phy/phy.c
@@ -563,7 +563,7 @@ phy_get_by_ofw_property(device_t consumer_dev, phandle_t cnode, char *name,
"%s called on not ofw based device\n", __func__);
return (ENXIO);
}
- ncells = OF_getencprop_alloc(cnode, name, sizeof(pcell_t),
+ ncells = OF_getencprop_alloc_multi(cnode, name, sizeof(pcell_t),
(void **)&cells);
if (ncells < 1)
return (ENXIO);
diff --git a/sys/dev/extres/regulator/regulator.c b/sys/dev/extres/regulator/regulator.c
index d0528093e228..535665fcd1ec 100644
--- a/sys/dev/extres/regulator/regulator.c
+++ b/sys/dev/extres/regulator/regulator.c
@@ -1085,7 +1085,7 @@ regulator_get_by_ofw_property(device_t cdev, phandle_t cnode, char *name,
}
cells = NULL;
- ncells = OF_getencprop_alloc(cnode, name, sizeof(*cells),
+ ncells = OF_getencprop_alloc_multi(cnode, name, sizeof(*cells),
(void **)&cells);
if (ncells <= 0)
return (ENXIO);
diff --git a/sys/dev/extres/syscon/syscon.c b/sys/dev/extres/syscon/syscon.c
index c728f8435c13..3d69efca0b13 100644
--- a/sys/dev/extres/syscon/syscon.c
+++ b/sys/dev/extres/syscon/syscon.c
@@ -236,7 +236,7 @@ syscon_get_by_ofw_property(device_t cdev, phandle_t cnode, char *name,
"%s called on not ofw based device\n", __func__);
return (ENXIO);
}
- ncells = OF_getencprop_alloc(cnode, name, sizeof(pcell_t),
+ ncells = OF_getencprop_alloc_multi(cnode, name, sizeof(pcell_t),
(void **)&cells);
if (ncells < 1)
return (ENXIO);