827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. From ff24fed10ba414d19579e26e60b126fad2f2bb07 Mon Sep 17 00:00:00 2001
  2. From: Michael Walle <[email protected]>
  3. Date: Mon, 6 Feb 2023 13:43:44 +0000
  4. Subject: [PATCH] of: property: make #.*-cells optional for simple props
  5. Sometimes, future bindings for phandles will get additional arguments.
  6. Thus the target node of the phandle will need a new #.*-cells property.
  7. To be backwards compatible, this needs to be optional.
  8. Prepare the DEFINE_SIMPLE_PROPS() to handle the cells name as optional.
  9. Signed-off-by: Michael Walle <[email protected]>
  10. Tested-by: Miquel Raynal <[email protected]>
  11. Reviewed-by: Rob Herring <[email protected]>
  12. Signed-off-by: Srinivas Kandagatla <[email protected]>
  13. Link: https://lore.kernel.org/r/[email protected]
  14. Signed-off-by: Greg Kroah-Hartman <[email protected]>
  15. ---
  16. drivers/of/property.c | 4 ++--
  17. 1 file changed, 2 insertions(+), 2 deletions(-)
  18. --- a/drivers/of/property.c
  19. +++ b/drivers/of/property.c
  20. @@ -1144,8 +1144,8 @@ static struct device_node *parse_prop_ce
  21. if (strcmp(prop_name, list_name))
  22. return NULL;
  23. - if (of_parse_phandle_with_args(np, list_name, cells_name, index,
  24. - &sup_args))
  25. + if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index,
  26. + &sup_args))
  27. return NULL;
  28. return sup_args.np;