diff options
author | Mark Brown <broonie@sirena.org.uk> | 2013-04-27 21:13:37 -0400 |
---|---|---|
committer | Mark Brown <broonie@sirena.org.uk> | 2013-04-27 21:13:37 -0400 |
commit | 0e340ce1ddcf41ca435ef695ef004a6f587c749e (patch) | |
tree | 9f4cc87138ecf29762e1037a8c028c6ddd3ebc03 | |
parent | 97844ede9487fc7c4689ce1499bbaa10312618be (diff) | |
parent | 020501f1a0911af70873e4d3d122b2e1889ccd03 (diff) |
Merge remote-tracking branch 'regulator/topic/core' into v3.9-rc8
-rw-r--r-- | drivers/regulator/core.c | 23 | ||||
-rw-r--r-- | drivers/regulator/max1586.c | 3 | ||||
-rw-r--r-- | drivers/regulator/max8649.c | 6 | ||||
-rw-r--r-- | drivers/regulator/max8660.c | 3 | ||||
-rw-r--r-- | drivers/regulator/s5m8767.c | 6 | ||||
-rw-r--r-- | drivers/regulator/tps6524x-regulator.c | 3 | ||||
-rw-r--r-- | include/linux/regulator/consumer.h | 14 |
7 files changed, 34 insertions, 24 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 56f4ca0854c9..6437949849b0 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -116,7 +116,7 @@ static const char *rdev_get_name(struct regulator_dev *rdev) | |||
116 | * @supply: regulator supply name | 116 | * @supply: regulator supply name |
117 | * | 117 | * |
118 | * Extract the regulator device node corresponding to the supply name. | 118 | * Extract the regulator device node corresponding to the supply name. |
119 | * retruns the device node corresponding to the regulator if found, else | 119 | * returns the device node corresponding to the regulator if found, else |
120 | * returns NULL. | 120 | * returns NULL. |
121 | */ | 121 | */ |
122 | static struct device_node *of_get_regulator(struct device *dev, const char *supply) | 122 | static struct device_node *of_get_regulator(struct device *dev, const char *supply) |
@@ -1229,7 +1229,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, | |||
1229 | struct regulator_dev *rdev; | 1229 | struct regulator_dev *rdev; |
1230 | struct regulator *regulator = ERR_PTR(-EPROBE_DEFER); | 1230 | struct regulator *regulator = ERR_PTR(-EPROBE_DEFER); |
1231 | const char *devname = NULL; | 1231 | const char *devname = NULL; |
1232 | int ret; | 1232 | int ret = 0; |
1233 | 1233 | ||
1234 | if (id == NULL) { | 1234 | if (id == NULL) { |
1235 | pr_err("get() with no identifier\n"); | 1235 | pr_err("get() with no identifier\n"); |
@@ -1245,6 +1245,15 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, | |||
1245 | if (rdev) | 1245 | if (rdev) |
1246 | goto found; | 1246 | goto found; |
1247 | 1247 | ||
1248 | /* | ||
1249 | * If we have return value from dev_lookup fail, we do not expect to | ||
1250 | * succeed, so, quit with appropriate error value | ||
1251 | */ | ||
1252 | if (ret) { | ||
1253 | regulator = ERR_PTR(ret); | ||
1254 | goto out; | ||
1255 | } | ||
1256 | |||
1248 | if (board_wants_dummy_regulator) { | 1257 | if (board_wants_dummy_regulator) { |
1249 | rdev = dummy_regulator_rdev; | 1258 | rdev = dummy_regulator_rdev; |
1250 | goto found; | 1259 | goto found; |
@@ -3512,7 +3521,14 @@ regulator_register(const struct regulator_desc *regulator_desc, | |||
3512 | 3521 | ||
3513 | r = regulator_dev_lookup(dev, supply, &ret); | 3522 | r = regulator_dev_lookup(dev, supply, &ret); |
3514 | 3523 | ||
3515 | if (!r) { | 3524 | if (ret == -ENODEV) { |
3525 | /* | ||
3526 | * No supply was specified for this regulator and | ||
3527 | * there will never be one. | ||
3528 | */ | ||
3529 | ret = 0; | ||
3530 | goto add_dev; | ||
3531 | } else if (!r) { | ||
3516 | dev_err(dev, "Failed to find supply %s\n", supply); | 3532 | dev_err(dev, "Failed to find supply %s\n", supply); |
3517 | ret = -EPROBE_DEFER; | 3533 | ret = -EPROBE_DEFER; |
3518 | goto scrub; | 3534 | goto scrub; |
@@ -3530,6 +3546,7 @@ regulator_register(const struct regulator_desc *regulator_desc, | |||
3530 | } | 3546 | } |
3531 | } | 3547 | } |
3532 | 3548 | ||
3549 | add_dev: | ||
3533 | /* add consumers devices */ | 3550 | /* add consumers devices */ |
3534 | if (init_data) { | 3551 | if (init_data) { |
3535 | for (i = 0; i < init_data->num_consumer_supplies; i++) { | 3552 | for (i = 0; i < init_data->num_consumer_supplies; i++) { |
diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index 8c5a54f541b5..6b2217b404b2 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c | |||
@@ -232,8 +232,7 @@ static int max1586_pmic_remove(struct i2c_client *client) | |||
232 | int i; | 232 | int i; |
233 | 233 | ||
234 | for (i = 0; i <= MAX1586_V6; i++) | 234 | for (i = 0; i <= MAX1586_V6; i++) |
235 | if (max1586->rdev[i]) | 235 | regulator_unregister(max1586->rdev[i]); |
236 | regulator_unregister(max1586->rdev[i]); | ||
237 | return 0; | 236 | return 0; |
238 | } | 237 | } |
239 | 238 | ||
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c index 3ca14380f22d..f44427003611 100644 --- a/drivers/regulator/max8649.c +++ b/drivers/regulator/max8649.c | |||
@@ -275,10 +275,8 @@ static int max8649_regulator_remove(struct i2c_client *client) | |||
275 | { | 275 | { |
276 | struct max8649_regulator_info *info = i2c_get_clientdata(client); | 276 | struct max8649_regulator_info *info = i2c_get_clientdata(client); |
277 | 277 | ||
278 | if (info) { | 278 | if (info) |
279 | if (info->regulator) | 279 | regulator_unregister(info->regulator); |
280 | regulator_unregister(info->regulator); | ||
281 | } | ||
282 | 280 | ||
283 | return 0; | 281 | return 0; |
284 | } | 282 | } |
diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c index 4d7c635c36c2..d428ef9a626f 100644 --- a/drivers/regulator/max8660.c +++ b/drivers/regulator/max8660.c | |||
@@ -426,8 +426,7 @@ static int max8660_remove(struct i2c_client *client) | |||
426 | int i; | 426 | int i; |
427 | 427 | ||
428 | for (i = 0; i < MAX8660_V_END; i++) | 428 | for (i = 0; i < MAX8660_V_END; i++) |
429 | if (max8660->rdev[i]) | 429 | regulator_unregister(max8660->rdev[i]); |
430 | regulator_unregister(max8660->rdev[i]); | ||
431 | return 0; | 430 | return 0; |
432 | } | 431 | } |
433 | 432 | ||
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 8a831947c351..2dd74e254397 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c | |||
@@ -923,8 +923,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) | |||
923 | return 0; | 923 | return 0; |
924 | err: | 924 | err: |
925 | for (i = 0; i < s5m8767->num_regulators; i++) | 925 | for (i = 0; i < s5m8767->num_regulators; i++) |
926 | if (rdev[i]) | 926 | regulator_unregister(rdev[i]); |
927 | regulator_unregister(rdev[i]); | ||
928 | 927 | ||
929 | return ret; | 928 | return ret; |
930 | } | 929 | } |
@@ -936,8 +935,7 @@ static int s5m8767_pmic_remove(struct platform_device *pdev) | |||
936 | int i; | 935 | int i; |
937 | 936 | ||
938 | for (i = 0; i < s5m8767->num_regulators; i++) | 937 | for (i = 0; i < s5m8767->num_regulators; i++) |
939 | if (rdev[i]) | 938 | regulator_unregister(rdev[i]); |
940 | regulator_unregister(rdev[i]); | ||
941 | 939 | ||
942 | return 0; | 940 | return 0; |
943 | } | 941 | } |
diff --git a/drivers/regulator/tps6524x-regulator.c b/drivers/regulator/tps6524x-regulator.c index 18b67d28d60b..1094393155ed 100644 --- a/drivers/regulator/tps6524x-regulator.c +++ b/drivers/regulator/tps6524x-regulator.c | |||
@@ -585,8 +585,7 @@ static int pmic_remove(struct spi_device *spi) | |||
585 | if (!hw) | 585 | if (!hw) |
586 | return 0; | 586 | return 0; |
587 | for (i = 0; i < N_REGULATORS; i++) { | 587 | for (i = 0; i < N_REGULATORS; i++) { |
588 | if (hw->rdev[i]) | 588 | regulator_unregister(hw->rdev[i]); |
589 | regulator_unregister(hw->rdev[i]); | ||
590 | hw->rdev[i] = NULL; | 589 | hw->rdev[i] = NULL; |
591 | } | 590 | } |
592 | spi_set_drvdata(spi, NULL); | 591 | spi_set_drvdata(spi, NULL); |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 7bc732ce6e50..145022a83085 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -141,18 +141,18 @@ void regulator_put(struct regulator *regulator); | |||
141 | void devm_regulator_put(struct regulator *regulator); | 141 | void devm_regulator_put(struct regulator *regulator); |
142 | 142 | ||
143 | /* regulator output control and status */ | 143 | /* regulator output control and status */ |
144 | int regulator_enable(struct regulator *regulator); | 144 | int __must_check regulator_enable(struct regulator *regulator); |
145 | int regulator_disable(struct regulator *regulator); | 145 | int regulator_disable(struct regulator *regulator); |
146 | int regulator_force_disable(struct regulator *regulator); | 146 | int regulator_force_disable(struct regulator *regulator); |
147 | int regulator_is_enabled(struct regulator *regulator); | 147 | int regulator_is_enabled(struct regulator *regulator); |
148 | int regulator_disable_deferred(struct regulator *regulator, int ms); | 148 | int regulator_disable_deferred(struct regulator *regulator, int ms); |
149 | 149 | ||
150 | int regulator_bulk_get(struct device *dev, int num_consumers, | 150 | int __must_check regulator_bulk_get(struct device *dev, int num_consumers, |
151 | struct regulator_bulk_data *consumers); | 151 | struct regulator_bulk_data *consumers); |
152 | int devm_regulator_bulk_get(struct device *dev, int num_consumers, | 152 | int __must_check devm_regulator_bulk_get(struct device *dev, int num_consumers, |
153 | struct regulator_bulk_data *consumers); | 153 | struct regulator_bulk_data *consumers); |
154 | int regulator_bulk_enable(int num_consumers, | 154 | int __must_check regulator_bulk_enable(int num_consumers, |
155 | struct regulator_bulk_data *consumers); | 155 | struct regulator_bulk_data *consumers); |
156 | int regulator_bulk_disable(int num_consumers, | 156 | int regulator_bulk_disable(int num_consumers, |
157 | struct regulator_bulk_data *consumers); | 157 | struct regulator_bulk_data *consumers); |
158 | int regulator_bulk_force_disable(int num_consumers, | 158 | int regulator_bulk_force_disable(int num_consumers, |