Commit Graph

3 Commits

Author SHA1 Message Date
Mark Brown
ef126a4a81 regulator: of: Add stub OF match function for !OF case
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-10 16:40:07 +01:00
Mark Brown
a0c7b164ad regulator: of: Provide simplified DT parsing method
Currently regulator drivers which support DT all repeat very similar code
to supply a list of known regulator identifiers to be matched with DT,
convert that to platform data which is then matched up with the regulators
as they are registered. This is both fiddly to get right and for devices
which can use the standard helpers to provide their operations is the main
source of code in the driver.

Since this code is essentially identical for most drivers we can factor it
out into the core, moving the identifiers in the match table into the
regulator descriptors and also allowing drivers to pass in the name of the
subnode to search. When a driver provides an of_match string for the
regulator the core will attempt to use that to obtain init_data, allowing
the driver to remove all explicit code for DT parsing and simply provide
data instead.

The current code leaks the phandles for the child nodes, this will be
addressed incrementally and makes no practical difference for FDT anyway
as the DT data structures are never freed.

Signed-off-by: Mark Brown <broonie@linaro.org>
2014-09-10 12:00:53 +01:00
Mark Brown
0cdfcc0f93 regulator: core: Split devres code out into a separate file
Cut down on the size of core.c a bit more and ensure that the devres
versions of things don't do too much peering inside the internals of
the APIs they wrap.

Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-17 00:28:45 +01:00