提交 23b5cc2a 编写于 作者: J Jani Nikula 提交者: Liam Girdwood

regulator: prevent registration of matching regulator consumer supplies

Acked-by: NMark 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: NJani Nikula <ext-jani.1.nikula@nokia.com>
Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
上级 0178f3e2
......@@ -944,8 +944,13 @@ static int set_consumer_device_supply(struct regulator_dev *rdev,
has_dev = 0;
list_for_each_entry(node, &regulator_map_list, list) {
if (consumer_dev_name != node->dev_name)
if (node->dev_name && consumer_dev_name) {
if (strcmp(node->dev_name, consumer_dev_name) != 0)
continue;
} else if (node->dev_name || consumer_dev_name) {
continue;
}
if (strcmp(node->supply, supply) != 0)
continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册