aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-u300/i2c.c2
-rw-r--r--drivers/mfd/twl-core.c8
-rw-r--r--drivers/regulator/core.c25
-rw-r--r--include/linux/regulator/machine.h2
4 files changed, 12 insertions, 25 deletions
diff --git a/arch/arm/mach-u300/i2c.c b/arch/arm/mach-u300/i2c.c
index 5140deeddf7b..a38f80238ea9 100644
--- a/arch/arm/mach-u300/i2c.c
+++ b/arch/arm/mach-u300/i2c.c
@@ -60,7 +60,6 @@ static struct regulator_consumer_supply supply_ldo_c[] = {
60 */ 60 */
61static struct regulator_consumer_supply supply_ldo_d[] = { 61static struct regulator_consumer_supply supply_ldo_d[] = {
62 { 62 {
63 .dev = NULL,
64 .supply = "vana15", /* Powers the SoC (CPU etc) */ 63 .supply = "vana15", /* Powers the SoC (CPU etc) */
65 }, 64 },
66}; 65};
@@ -92,7 +91,6 @@ static struct regulator_consumer_supply supply_ldo_k[] = {
92 */ 91 */
93static struct regulator_consumer_supply supply_ldo_ext[] = { 92static struct regulator_consumer_supply supply_ldo_ext[] = {
94 { 93 {
95 .dev = NULL,
96 .supply = "vext", /* External power */ 94 .supply = "vext", /* External power */
97 }, 95 },
98}; 96};
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 8ce3959c6919..c1e4f1a277e9 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -753,9 +753,9 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
753 753
754 /* we need to connect regulators to this transceiver */ 754 /* we need to connect regulators to this transceiver */
755 if (twl_has_regulator() && child) { 755 if (twl_has_regulator() && child) {
756 usb1v5.dev = child; 756 usb1v5.dev_name = dev_name(child);
757 usb1v8.dev = child; 757 usb1v8.dev_name = dev_name(child);
758 usb3v1.dev = child; 758 usb3v1.dev_name = dev_name(child);
759 } 759 }
760 } 760 }
761 if (twl_has_usb() && pdata->usb && twl_class_is_6030()) { 761 if (twl_has_usb() && pdata->usb && twl_class_is_6030()) {
@@ -801,7 +801,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
801 return PTR_ERR(child); 801 return PTR_ERR(child);
802 /* we need to connect regulators to this transceiver */ 802 /* we need to connect regulators to this transceiver */
803 if (twl_has_regulator() && child) 803 if (twl_has_regulator() && child)
804 usb3v3.dev = child; 804 usb3v3.dev_name = dev_name(child);
805 } else if (twl_has_regulator() && twl_class_is_6030()) { 805 } else if (twl_has_regulator() && twl_class_is_6030()) {
806 if (features & TWL6025_SUBCLASS) 806 if (features & TWL6025_SUBCLASS)
807 child = add_regulator(TWL6025_REG_LDOUSB, 807 child = add_regulator(TWL6025_REG_LDOUSB,
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) {
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index f3f13fd5868f..7abb16093312 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -139,12 +139,10 @@ struct regulation_constraints {
139 * make struct device available late such as I2C and is the preferred 139 * make struct device available late such as I2C and is the preferred
140 * form. 140 * form.
141 * 141 *
142 * @dev: Device structure for the consumer.
143 * @dev_name: Result of dev_name() for the consumer. 142 * @dev_name: Result of dev_name() for the consumer.
144 * @supply: Name for the supply. 143 * @supply: Name for the supply.
145 */ 144 */
146struct regulator_consumer_supply { 145struct regulator_consumer_supply {
147 struct device *dev; /* consumer */
148 const char *dev_name; /* dev_name() for consumer */ 146 const char *dev_name; /* dev_name() for consumer */
149 const char *supply; /* consumer supply - e.g. "vcc" */ 147 const char *supply; /* consumer supply - e.g. "vcc" */
150}; 148};