Re: [PATCH v3 2/3] of: add optional options parameter to of_find_node_by_path()

From: Leif Lindholm
Date: Fri Mar 06 2015 - 11:53:04 EST


Hi Peter,

On Wed, Mar 04, 2015 at 10:45:02AM -0500, Peter Hurley wrote:
> The path parsing gets lost if the string after ':' contains '/'.

Doh!
Thanks for reporting (and sorry for slow response).

> The selftests below fail with:
> [ 1.365528] ### dt-test ### FAIL of_selftest_find_node_by_name():99 option path test failed
> [ 1.365610] ### dt-test ### FAIL of_selftest_find_node_by_name():115 option alias path test failed
>
> Regards,
> Peter Hurley
>
>
> --- >% ---
> diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
> index 41a4a13..07ba5aa 100644
> --- a/drivers/of/unittest.c
> +++ b/drivers/of/unittest.c
> @@ -94,6 +94,11 @@ static void __init of_selftest_find_node_by_name(void)
> "option path test failed\n");
> of_node_put(np);
>
> + np = of_find_node_opts_by_path("/testcase-data:test/option", &options);
> + selftest(np && !strcmp("test/option", options),
> + "option path test failed\n");
> + of_node_put(np);
> +
> np = of_find_node_opts_by_path("/testcase-data:testoption", NULL);
> selftest(np, "NULL option path test failed\n");
> of_node_put(np);
> @@ -104,6 +109,12 @@ static void __init of_selftest_find_node_by_name(void)
> "option alias path test failed\n");
> of_node_put(np);
>
> + np = of_find_node_opts_by_path("testcase-alias:test/alias/option",
> + &options);
> + selftest(np && !strcmp("test/alias/option", options),
> + "option alias path test failed\n");
> + of_node_put(np);
> +
> np = of_find_node_opts_by_path("testcase-alias:testaliasoption", NULL);
> selftest(np, "NULL option alias path test failed\n");
> of_node_put(np);

Could you give the below a spin, and if it works for you, send me the
above tests as a full patch so that I can post both as a series?

Regards,

Leif