Skip to main content

fdt_getprop

Function fdt_getprop 

Source
pub unsafe extern "C" fn fdt_getprop(
    fdt: *const c_void,
    nodeoffset: c_int,
    name: *const c_char,
    lenp: *mut c_int,
) -> *const c_void
Expand description

fdt_getprop - retrieve the value of a given property @fdt: pointer to the device tree blob @nodeoffset: offset of the node whose property to find @name: name of the property to find @lenp: pointer to an integer variable (will be overwritten) or NULL

fdt_getprop() retrieves a pointer to the value of the property named @name of the node at offset @nodeoffset (this will be a pointer to within the device blob itself, not a copy of the value). If @lenp is non-NULL, the length of the property value is also returned, in the integer pointed to by @lenp.

returns: pointer to the property’s value if lenp is non-NULL, *lenp contains the length of the property value (>=0) NULL, on error if lenp is non-NULL, *lenp contains an error code (<0): -FDT_ERR_NOTFOUND, node does not have named property -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag -FDT_ERR_BADMAGIC, -FDT_ERR_BADVERSION, -FDT_ERR_BADSTATE, -FDT_ERR_BADSTRUCTURE, -FDT_ERR_TRUNCATED, standard meanings