diff options
author | Oleksandr Tymoshenko <gonzo@FreeBSD.org> | 2018-04-08 22:59:34 +0000 |
---|---|---|
committer | Oleksandr Tymoshenko <gonzo@FreeBSD.org> | 2018-04-08 22:59:34 +0000 |
commit | 217d17bcd3f525fbdf124cfbc926f8033da69805 (patch) | |
tree | 146d3c2e0fb57898ccf50e647f680a89962f5c1b /sys/powerpc/psim | |
parent | 9d9889b5eb221519c15655e86892440972fc2886 (diff) | |
download | src-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/powerpc/psim')
-rw-r--r-- | sys/powerpc/psim/iobus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c index 320d3a880b6d..a4c0d77d110e 100644 --- a/sys/powerpc/psim/iobus.c +++ b/sys/powerpc/psim/iobus.c @@ -221,7 +221,7 @@ iobus_attach(device_t dev) root = sc->sc_node; for (child = OF_child(root); child != 0; child = OF_peer(child)) { - OF_getprop_alloc(child, "name", 1, (void **)&name); + OF_getprop_alloc(child, "name", (void **)&name); cdev = device_add_child(dev, NULL, -1); if (cdev != NULL) { |