From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: <broonie@kernel.org>
Cc: <lgirdwood@gmail.com>, <linux-kernel@vger.kernel.org>,
<patches@opensource.cirrus.com>
Subject: [PATCH] regulator: core: Prioritise consumer mappings over regulator name
Date: Mon, 12 Jun 2017 16:17:52 +0100 [thread overview]
Message-ID: <1497280672-24011-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
Currently, when looking up a regulator supply, the regulator name
takes priority over the consumer mappings. As there are a lot of
regulator names that are in fairly common use (VDD, MICVDD, etc.) this
can easily lead to obtaining the wrong supply, when a system contains
two regulators that share a name.
The explicit consumer mappings contain much less ambiguity as they
specify both a name and a consumer device. As such prioritise those if
one exists and only fall back to the regulator name if there are no
matching explicit mappings.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
drivers/regulator/core.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 919b7f1..d257952 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1490,8 +1490,6 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev,
devname = dev_name(dev);
r = regulator_lookup_by_name(supply);
- if (r)
- return r;
mutex_lock(®ulator_list_mutex);
list_for_each_entry(map, ®ulator_map_list, list) {
--
2.1.4
next reply other threads:[~2017-06-12 15:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-12 15:17 Charles Keepax [this message]
2017-06-12 16:38 ` [PATCH] regulator: core: Prioritise consumer mappings over regulator name Mark Brown
2017-06-13 8:07 ` Charles Keepax
2017-06-13 10:15 ` Mark Brown
2017-06-13 13:16 ` Charles Keepax
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1497280672-24011-1-git-send-email-ckeepax@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox