*参照元 [#g8288de4] #backlinks *説明 [#efbccee8] -パス: [[linux-4.4.1/drivers/of/platform.c]] -FIXME: これは何? --説明 **引数 [#k5c770d8] -struct device_node *root -- --[[linux-4.4.1/device_node]] -const struct of_device_id *matches -- --[[linux-4.4.1/of_device_id]] -const struct of_dev_auxdata *lookup -- --[[linux-4.4.1/of_dev_auxdata]] -struct device *parent -- --[[linux-4.4.1/device]] **返り値 [#te89905a] -int -- **参考 [#hb30b6dd] *実装 [#c1364f3b] /** * of_platform_populate() - Populate platform_devices from device tree data * @root: parent of the first level to probe or NULL for the root of the tree * @matches: match table, NULL to use the default * @lookup: auxdata table for matching id and platform_data with device nodes * @parent: parent to hook devices from, NULL for toplevel * * 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(). * * Returns 0 on success, < 0 on failure. */ int of_platform_populate(struct device_node *root, const struct of_device_id *matches, const struct of_dev_auxdata *lookup, struct device *parent) { struct device_node *child; int rc = 0; - --[[linux-4.4.1/device_node]] root = root ? of_node_get(root) : of_find_node_by_path("/"); if (!root) return -EINVAL; - --[[linux-4.4.1/of_node_get()]] --[[linux-4.4.1/of_find_node_by_path()]] for_each_child_of_node(root, child) { rc = of_platform_bus_create(child, matches, lookup, parent, true); if (rc) { of_node_put(child); break; } } of_node_set_flag(root, OF_POPULATED_BUS); - --[[linux-4.4.1/for_each_child_of_node()]] --[[linux-4.4.1/of_platform_bus_create()]] --[[linux-4.4.1/of_node_put()]] --[[linux-4.4.1/of_node_set_flag()]] of_node_put(root); return rc; } EXPORT_SYMBOL_GPL(of_platform_populate); - --[[linux-4.4.1/EXPORT_SYMBOL_GPL()]] *コメント [#ve8d4361]