regulator: ti-abb-regulator: do not open-code counting and access of dt array elements
authorHeiko Stuebner <heiko.stuebner@bqreaders.com>
Wed, 12 Feb 2014 00:01:42 +0000 (01:01 +0100)
committerMark Brown <broonie@linaro.org>
Wed, 12 Feb 2014 15:51:25 +0000 (15:51 +0000)
commit5c24d355dd9af29abb25fb3891122af5e80a551d
treee493f5910d2ad6af1131cae38aed62fe95bcb7a5
parent13cf4ea01abcc7868c64ce0f26dd5cb3abafda4c
regulator: ti-abb-regulator: do not open-code counting and access of dt array elements

Open coding the counting of elements in a dt-property is abstracted by the newly
introduced of_property_count_uXX_elems functions. Additionally the raw iteration
over the states element exposes the endian conversion and dtb-format details,
which according to Mark Rutland "would be nice to limit [...] to of_ helper
functions".

Thus change ti-abb-regulator to use the helper for element counting and
of_property_read_u32_index for retrieval of individual values.

This makes it possible to remove the raw access to the property entirely.

Signed-off-by: Heiko Stuebner <heiko.stuebner@bqreaders.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/ti-abb-regulator.c
This page took 0.033913 seconds and 5 git commands to generate.