summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-18 17:39:19 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-18 17:39:19 -0400
commit115e4bfd5bc68f870b3c889ab8f2d2733bcda452 (patch)
treed72053747d59cd5c537919990144c078d6b8cb55 /drivers/regulator
parentc02f935f5f646fe1b5dbcd909e9d09c3a912914e (diff)
parent5bc78015998e14bf0362a01fc47e8b63053dbfd8 (diff)
Merge remote-tracking branch 'regulator/topic/supply' into regulator-next
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index f4d31830f12b..e2f3afa71efb 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -995,7 +995,6 @@ static int set_supply(struct regulator_dev *rdev,
995/** 995/**
996 * set_consumer_device_supply - Bind a regulator to a symbolic supply 996 * set_consumer_device_supply - Bind a regulator to a symbolic supply
997 * @rdev: regulator source 997 * @rdev: regulator source
998 * @consumer_dev: device the supply applies to
999 * @consumer_dev_name: dev_name() string for device supply applies to 998 * @consumer_dev_name: dev_name() string for device supply applies to
1000 * @supply: symbolic name for supply 999 * @supply: symbolic name for supply
1001 * 1000 *
@@ -1003,22 +1002,14 @@ static int set_supply(struct regulator_dev *rdev,
1003 * sources to symbolic names for supplies for use by devices. Devices 1002 * sources to symbolic names for supplies for use by devices. Devices
1004 * should use these symbolic names to request regulators, avoiding the 1003 * should use these symbolic names to request regulators, avoiding the
1005 * need to provide board-specific regulator names as platform data. 1004 * need to provide board-specific regulator names as platform data.
1006 *
1007 * Only one of consumer_dev and consumer_dev_name may be specified.
1008 */ 1005 */
1009static int set_consumer_device_supply(struct regulator_dev *rdev, 1006static int set_consumer_device_supply(struct regulator_dev *rdev,
1010 struct device *consumer_dev, const char *consumer_dev_name, 1007 const char *consumer_dev_name,
1011 const char *supply) 1008 const char *supply)
1012{ 1009{
1013 struct regulator_map *node; 1010 struct regulator_map *node;
1014 int has_dev; 1011 int has_dev;
1015 1012
1016 if (consumer_dev && consumer_dev_name)
1017 return -EINVAL;
1018
1019 if (!consumer_dev_name && consumer_dev)
1020 consumer_dev_name = dev_name(consumer_dev);
1021
1022 if (supply == NULL) 1013 if (supply == NULL)
1023 return -EINVAL; 1014 return -EINVAL;
1024 1015
@@ -1038,11 +1029,12 @@ static int set_consumer_device_supply(struct regulator_dev *rdev,
1038 if (strcmp(node->supply, supply) != 0) 1029 if (strcmp(node->supply, supply) != 0)
1039 continue; 1030 continue;
1040 1031
1041 dev_dbg(consumer_dev, "%s/%s is '%s' supply; fail %s/%s\n", 1032 pr_debug("%s: %s/%s is '%s' supply; fail %s/%s\n",
1042 dev_name(&node->regulator->dev), 1033 consumer_dev_name,
1043 node->regulator->desc->name, 1034 dev_name(&node->regulator->dev),
1044 supply, 1035 node->regulator->desc->name,
1045 dev_name(&rdev->dev), rdev_get_name(rdev)); 1036 supply,
1037 dev_name(&rdev->dev), rdev_get_name(rdev));
1046 return -EBUSY; 1038 return -EBUSY;
1047 } 1039 }
1048 1040
@@ -2955,7 +2947,6 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
2955 if (init_data) { 2947 if (init_data) {
2956 for (i = 0; i < init_data->num_consumer_supplies; i++) { 2948 for (i = 0; i < init_data->num_consumer_supplies; i++) {
2957 ret = set_consumer_device_supply(rdev, 2949 ret = set_consumer_device_supply(rdev,
2958 init_data->consumer_supplies[i].dev,
2959 init_data->consumer_supplies[i].dev_name, 2950 init_data->consumer_supplies[i].dev_name,
2960 init_data->consumer_supplies[i].supply); 2951 init_data->consumer_supplies[i].supply);
2961 if (ret < 0) { 2952 if (ret < 0) {