aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/vnic/thunder_bgx_fdt.c
diff options
context:
space:
mode:
authorOleksandr Tymoshenko <gonzo@FreeBSD.org>2018-04-08 22:59:34 +0000
committerOleksandr Tymoshenko <gonzo@FreeBSD.org>2018-04-08 22:59:34 +0000
commit217d17bcd3f525fbdf124cfbc926f8033da69805 (patch)
tree146d3c2e0fb57898ccf50e647f680a89962f5c1b /sys/dev/vnic/thunder_bgx_fdt.c
parent9d9889b5eb221519c15655e86892440972fc2886 (diff)
downloadsrc-217d17bcd3f525fbdf124cfbc926f8033da69805.tar.gz
src-217d17bcd3f525fbdf124cfbc926f8033da69805.zip
Clean up OF_getprop_alloc API
OF_getprop_alloc takes element size argument and returns number of elements in the property. There are valid use cases for such behavior but mostly API consumers pass 1 as element size to get string properties. What API users would expect from OF_getprop_alloc is to be a combination of malloc + OF_getprop with the same semantic of return value. This patch modifies API signature to match these expectations. For the valid use cases with element size != 1 and to reduce modification scope new OF_getprop_alloc_multi function has been introduced that behaves the same way OF_getprop_alloc behaved prior to this patch. Reviewed by: ian, manu Differential Revision: https://reviews.freebsd.org/D14850
Notes
Notes: svn path=/head/; revision=332310
Diffstat (limited to 'sys/dev/vnic/thunder_bgx_fdt.c')
-rw-r--r--sys/dev/vnic/thunder_bgx_fdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/vnic/thunder_bgx_fdt.c b/sys/dev/vnic/thunder_bgx_fdt.c
index 380d7f90697e..bdb7594a0fb4 100644
--- a/sys/dev/vnic/thunder_bgx_fdt.c
+++ b/sys/dev/vnic/thunder_bgx_fdt.c
@@ -396,7 +396,7 @@ bgx_fdt_init_phy(struct bgx *bgx)
continue;
}
} else {
- len = OF_getprop_alloc(child, "name", 1,
+ len = OF_getprop_alloc(child, "name",
(void **)&node_name);
if (len <= 0) {
continue;