Guest User

Untitled

a guest
Aug 8th, 2018
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. commit 9c2a3c9e4e0c3994c82bdb6b3278cdcd0cb2068b
  2. Author: Stephen Warren <swarren@nvidia.com>
  3. Date: Wed Apr 4 09:27:46 2012 -0600
  4.  
  5. dt: add property iteration helpers
  6.  
  7. This patch adds macros of_property_for_each_u32() and
  8. of_property_for_each_string(), which iterate over an array of values
  9. within a device-tree property. Usage is for example:
  10.  
  11. struct property *prop;
  12. const __be32 *p;
  13. u32 u;
  14. of_property_for_each_u32(np, "propname", prop, p, u)
  15. printk("U32 value: %x\n", u);
  16.  
  17. struct property *prop;
  18. const char *s;
  19. of_property_for_each_string(np, "propname", prop, s)
  20. printk("String value: %s\n", s);
  21.  
  22. Based on work by Rob Herring <robherring2@gmail.com>
  23.  
  24. Cc: Grant Likely <grant.likely@secretlab.ca>
  25. Signed-off-by: Stephen Warren <swarren@nvidia.com>
  26. Acked-by: Rob Herring <rob.herring@calxeda.com>
  27. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Add Comment
Please, Sign In to add comment