[PATCH v2 1/8] of_path: of_find_path() factor out device detection logic into separate function
Trent Piepho
tpiepho at kymetacorp.com
Thu Dec 10 14:38:35 PST 2015
On Tue, 2015-10-20 at 10:39 +0200, Marc Kleine-Budde wrote:
> This patch factors out the device detection logic into separate function, so
> that it can be used from another function.
The use of device-path = &mmc0, "partname:0"; breaks because it tries to
get the "partname:0" string by looking at "device-path" in &mmc0. It
should be looking for device-path in the original node.
> +int __of_find_path(struct device_node *node, const char *propname, char **outpath, unsigned flags)
> +{
> + while (propname) {
> + ret = of_property_read_string_index(node, propname, i++, &str);
Here 'node' is the device node pointed to by propname in the node
originally passed to of_find_path(). I.e., &mmc0.
> int of_find_path(struct device_node *node, const char *propname, char **outpath, unsigned flags)
> {
> -
> - while (1) {
> - ret = of_property_read_string_index(node, propname, i++, &str);
> - if (ret)
But here 'node' is the node that is passed to of_find_path.
> + return __of_find_path(rnode, propname, outpath, flags);
Because here you pass rnode, not node, to __of_find_path() and then use
it where the original code used node.
More information about the barebox
mailing list