fdt_getprop

The interface has the following parameters.
  • Synopsis:
    const void *fdt_getprop(const void *fdt, int nodeoffset, const char *name, int *lenp)
  • Description: The interface is used to retrieve the value of a given property.
  • Parameter:
    • fdt: The pointer to the DTB file.
    • nodeoffset: The offset of the node to get property from.
    • name: The name of the property.
    • lenp: The pointer to an integer variable (will be overwritten) or NULL.
  • Return:
    • Success: The pointer to the property's value.

      If lenp is not NULL, *lenp will contain the length of the property value (>= 0).

    • Failure: NULL.
      If lenp is not NULL, *lenp will contain an error code (< 0):
      • FDT_ERR_NOTFOUND: The target property is not found.
      • FDT_ERR_BADOFFSET: The node offset is invalid. The node offset does not point to the FDT_BEGIN_NODE tag.
      • FDT_ERR_BADMAGIC: The magic field is invalid.
      • FDT_ERR_BADVERSION: The version is invalid.
      • FDT_ERR_BADSTATE: The state is invalid.
      • FDT_ERR_BADSTRUCTURE: The file structure is invalid.
      • FDT_ERR_TRUNCATED, standard meanings.