Skip to main content

fdt_get_path

Function fdt_get_path 

Source
pub unsafe extern "C" fn fdt_get_path(
    fdt: *const c_void,
    nodeoffset: c_int,
    buf: *mut c_char,
    buflen: c_int,
) -> c_int
Expand description

fdt_get_path - determine the full path of a node @fdt: pointer to the device tree blob @nodeoffset: offset of the node whose path to find @buf: character buffer to contain the returned path (will be overwritten) @buflen: size of the character buffer at buf

fdt_get_path() computes the full path of the node at offset nodeoffset, and records that path in the buffer at buf.

NOTE: This function is expensive, as it must scan the device tree structure from the start to nodeoffset.

returns: 0, on success buf contains the absolute path of the node at nodeoffset, as a NUL-terminated string. -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1) characters and will not fit in the given buffer. -FDT_ERR_BADMAGIC, -FDT_ERR_BADVERSION, -FDT_ERR_BADSTATE, -FDT_ERR_BADSTRUCTURE, standard meanings