aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorJani Nikula <ext-jani.1.nikula@nokia.com>2010-04-29 03:55:09 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-05-25 05:16:01 -0400
commit23b5cc2ab6783256cf06779e1d522482b819b808 (patch)
tree14a9fdb2ee8742a543cd4d62d3890063718af772 /drivers/regulator
parent0178f3e28e2166664916265c5d4922b1376b9fa1 (diff)
regulator: prevent registration of matching regulator consumer supplies
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Pointer comparison is not sufficient for non-NULL device name matching, so use strcmp(). Otherwise the semantics remain the same. Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index eb112d961515..2a3494f72465 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -944,8 +944,13 @@ static int set_consumer_device_supply(struct regulator_dev *rdev,
944 has_dev = 0; 944 has_dev = 0;
945 945
946 list_for_each_entry(node, &regulator_map_list, list) { 946 list_for_each_entry(node, &regulator_map_list, list) {
947 if (consumer_dev_name != node->dev_name) 947 if (node->dev_name && consumer_dev_name) {
948 if (strcmp(node->dev_name, consumer_dev_name) != 0)
949 continue;
950 } else if (node->dev_name || consumer_dev_name) {
948 continue; 951 continue;
952 }
953
949 if (strcmp(node->supply, supply) != 0) 954 if (strcmp(node->supply, supply) != 0)
950 continue; 955 continue;
951 956