Skip to content

Device Tree

Nodes

Getting nodes

Source

There are a lot of different ways to do this dependent on what information you have. The of_find_### functions are probably what you need.

When finished you need to free the node.

Freeing nodes

of_node_put(node);

Get resource from a node

The data in a node is referred to as a resource. There are various ways to get this, one of the most simple is of_address_to_resource.

This does not need freeing when done.

Resources

Size

resource_size(&res)

Note

This is a simple inline function defined as:

static inline resource_size_t resource_size(const struct resource *res)
{
    return res->end - res->start + 1;
}