return 0;
}
-const void *ofnode_get_property_by_prop(const struct ofprop *prop,
- const char **propname, int *lenp)
+const void *ofprop_get_property(const struct ofprop *prop,
+ const char **propname, int *lenp)
{
if (ofnode_is_np(prop->node))
return of_get_property_by_prop(ofnode_to_np(prop->node),
const void *dev_read_prop_by_prop(struct ofprop *prop,
const char **propname, int *lenp)
{
- return ofnode_get_property_by_prop(prop, propname, lenp);
+ return ofprop_get_property(prop, propname, lenp);
}
int dev_read_alias_seq(const struct udevice *dev, int *devnump)
res = ofnode_next_property(&prop)) {
const char *name, *val;
- val = ofnode_get_property_by_prop(&prop, &name, NULL);
+ val = ofprop_get_property(&prop, &name, NULL);
env_set(name, val);
}
}
* ofnode_first_property()- get the reference of the first property
*
* Get reference to the first property of the node, it is used to iterate
- * and read all the property with ofnode_get_property_by_prop().
+ * and read all the property with ofprop_get_property().
*
* @node: node to read
* @prop: place to put argument reference
* ofnode_next_property() - get the reference of the next property
*
* Get reference to the next property of the node, it is used to iterate
- * and read all the property with ofnode_get_property_by_prop().
+ * and read all the property with ofprop_get_property().
*
* @prop: reference of current argument and place to put reference of next one
* Return: 0 if OK, -ve on error. -FDT_ERR_NOTFOUND if not found
int ofnode_next_property(struct ofprop *prop);
/**
- * ofnode_get_property_by_prop() - get a pointer to the value of a property
+ * ofprop_get_property() - get a pointer to the value of a property
*
* Get value for the property identified by the provided reference.
*
* @prop: reference on property
* @propname: If non-NULL, place to property name on success,
- * @lenp: If non-NULL, place to put length on success
- * Return: 0 if OK, -ve on error. -FDT_ERR_NOTFOUND if not found
+ * @lenp: If non-NULL, place to put length on success, or error code on failure
+ * Return: pointer to property, or NULL if not found
*/
-const void *ofnode_get_property_by_prop(const struct ofprop *prop,
- const char **propname, int *lenp);
+const void *ofprop_get_property(const struct ofprop *prop,
+ const char **propname, int *lenp);
/**
* ofnode_is_available() - check if a node is marked available
const char **propname,
int *lenp)
{
- return ofnode_get_property_by_prop(prop, propname, lenp);
+ return ofprop_get_property(prop, propname, lenp);
}
static inline int dev_read_alias_seq(const struct udevice *dev, int *devnump)
#include <dm/test.h>
#include <test/ut.h>
-static int dm_test_ofnode_get_property_by_prop(struct unit_test_state *uts)
+static int dm_test_ofprop_get_property(struct unit_test_state *uts)
{
ofnode node;
struct ofprop prop;
for (res = ofnode_first_property(node, &prop);
!res;
res = ofnode_next_property(&prop)) {
- value = ofnode_get_property_by_prop(&prop, &propname, &len);
+ value = ofprop_get_property(&prop, &propname, &len);
ut_assertnonnull(value);
switch (count) {
case 0:
return 0;
}
-DM_TEST(dm_test_ofnode_get_property_by_prop,
- UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+DM_TEST(dm_test_ofprop_get_property, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);