of: add functions to count number of elements in a property
The need to know the number of array elements in a property is a common pattern. To prevent duplication of open-coded implementations add a helper static function that also centralises strict sanity checking and DTB format details, as well as a set of wrapper functions for u8, u16, u32 and u64. Suggested-by: NMark Rutland <mark.rutland@arm.com> Signed-off-by: NHeiko Stuebner <heiko.stuebner@bqreaders.com> Acked-by: NRob Herring <robh@kernel.org> Acked-by: NGrant Likely <grant.likely@linaro.org> Acked-by: NMark Rutland <mark.rutland@arm.com> Signed-off-by: NMark Brown <broonie@linaro.org>
Showing
想要评论请 注册 或 登录