diff options
author | Javier Martinez Canillas <javier.martinez@collabora.co.uk> | 2014-11-10 16:43:54 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-26 21:58:14 +0300 |
commit | 75d6b2faf79cbe9086e831351d5d9085f1852928 (patch) | |
tree | 15538806a5ea1a7e01e56fad62e73e97780a993b | |
parent | 072e78b12bf5182a3e2e460388214a291023ef1c (diff) | |
download | linux-75d6b2faf79cbe9086e831351d5d9085f1852928.tar.xz |
regulator: of: Pass the regulator description in the match table
Drivers can use the of_regulator_match() function to parse the regulator
init_data from DT. A match table is used to specify the name of the node
containing the regulators, the device node and to return the init_data
to the caller.
But also the static regulator descriptor is needed to correctly extract
some DT properties like the regulator initial and suspend modes. Use the
match table to pass that information.
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/regulator/of_regulator.c | 3 | ||||
-rw-r--r-- | include/linux/regulator/of_regulator.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index 3687a1c38c1c..64c09a37ac7f 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c @@ -221,7 +221,8 @@ int of_regulator_match(struct device *dev, struct device_node *node, continue; match->init_data = - of_get_regulator_init_data(dev, child, NULL); + of_get_regulator_init_data(dev, child, + match->desc); if (!match->init_data) { dev_err(dev, "failed to parse DT for regulator %s\n", diff --git a/include/linux/regulator/of_regulator.h b/include/linux/regulator/of_regulator.h index 8d1d136c0fb9..763953f7e3b8 100644 --- a/include/linux/regulator/of_regulator.h +++ b/include/linux/regulator/of_regulator.h @@ -13,6 +13,7 @@ struct of_regulator_match { void *driver_data; struct regulator_init_data *init_data; struct device_node *of_node; + const struct regulator_desc *desc; }; #if defined(CONFIG_OF) |