Name

of_platform_populate — Populate platform_devices from device tree data

Synopsis

int of_platform_populate (struct device_node * root,
 const struct of_device_id * matches,
 const struct of_dev_auxdata * lookup,
 struct device * parent);
 

Arguments

root

Pointer to parent of the first level to probe

matches

Pointer to match table for child nodes

lookup

NULL or pointer to auxdata that contains compatible match tables

parent

Pointer to parent to hook devices from, NULL for toplevel

Description

If root is NULL, then root is the root of the tree.

Similar to of_platform_bus_probe, this function walks the device tree and creates devices from nodes. It differs in that it follows the modern convention of requiring all device nodes to have a 'compatible' property, and it is suitable for creating devices which are children of the root node (of_platform_bus_probe will only create children of the root which are selected by the matches argument).

New board support should be using this function instead of of_platform_bus_probe.

Also see

of_node_match, of_platform_bus_create, of_platform_bus_probe, of_platform_depopulate

Return

0 on success, -EINVAL on error.