of/address: Add of_range_count() helper
authorRob Herring <robh@kernel.org>
Tue, 28 Mar 2023 20:15:59 +0000 (15:15 -0500)
committerRob Herring <robh@kernel.org>
Thu, 13 Apr 2023 22:46:35 +0000 (17:46 -0500)
commitb50c788a56964a900ebcc817c8a5ad35ddad87b6
tree979111f2e492fe935904e94bc84f7a54176544d5
parent3d5089c4263d3594dc055e0f9c5cb990505cdd64
of/address: Add of_range_count() helper

Some users need a count of the number of ranges entries before
iterating over the entries. Typically this is for allocating some data
structure based on the size. Add a helper, of_range_count(), to get the
count. The helper must be called with an struct of_range_parser
initialized by of_range_parser_init().

Link: https://lore.kernel.org/r/20230328-dt-address-helpers-v1-4-e2456c3e77ab@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/unittest.c
include/linux/of_address.h