From: Jean Delvare <khali@linux-fr.org>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org,
Guenter Roeck <linux@roeck-us.net>,
Mark Brown <broonie@linaro.org>
Subject: Re: [PATCH] regulator: core: Correct default return value for full constraints
Date: Mon, 3 Feb 2014 10:41:41 +0100 [thread overview]
Message-ID: <20140203104141.40cc04e5@endymion.delvare> (raw)
In-Reply-To: <1390846075-17415-1-git-send-email-broonie@kernel.org>
Liam,
Can you please review / apply this patch? It fixes a real bug. I also
think it should go to the 3.13-stable tree.
Thanks,
Jean
On Mon, 27 Jan 2014 18:07:55 +0000, Mark Brown wrote:
> From: Mark Brown <broonie@linaro.org>
>
> Once we have full constraints then all supply mappings should be known to
> the regulator API. This means that we should treat failed lookups as fatal
> rather than deferring in the hope of further registrations but this was
> broken by commit 9b92da1f1205bd25 "regulator: core: Fix default return
> value for _get()" which was targeted at DT systems but unintentionally
> broke non-DT systems by changing the default return value.
>
> Fix this by explicitly returning -EPROBE_DEFER from the DT lookup if we
> find a property but no corresponding regulator and by having the non-DT
> case default to -ENODEV when we have full constraints.
>
> Fixes: 9b92da1f1205bd25 "regulator: core: Fix default return value for _get()"
> Signed-off-by: Mark Brown <broonie@linaro.org>
> ---
> drivers/regulator/core.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> index b38a6b669e8c..16a309e5c024 100644
> --- a/drivers/regulator/core.c
> +++ b/drivers/regulator/core.c
> @@ -1272,6 +1272,8 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev,
> if (r->dev.parent &&
> node == r->dev.of_node)
> return r;
> + *ret = -EPROBE_DEFER;
> + return NULL;
> } else {
> /*
> * If we couldn't even get the node then it's
> @@ -1312,7 +1314,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
> struct regulator_dev *rdev;
> struct regulator *regulator = ERR_PTR(-EPROBE_DEFER);
> const char *devname = NULL;
> - int ret = -EPROBE_DEFER;
> + int ret;
>
> if (id == NULL) {
> pr_err("get() with no identifier\n");
> @@ -1322,6 +1324,11 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
> if (dev)
> devname = dev_name(dev);
>
> + if (have_full_constraints())
> + ret = -ENODEV;
> + else
> + ret = -EPROBE_DEFER;
> +
> mutex_lock(®ulator_list_mutex);
>
> rdev = regulator_dev_lookup(dev, id, &ret);
--
Jean Delvare
next prev parent reply other threads:[~2014-02-03 9:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-27 18:07 Mark Brown
2014-02-03 9:41 ` Jean Delvare [this message]
2014-02-03 11:02 ` Mark Brown
2014-02-03 14:35 ` Jean Delvare
2014-02-03 15:41 ` Mark Brown
2014-02-03 16:52 ` Guenter Roeck
2014-02-03 17:31 ` Mark Brown
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=20140203104141.40cc04e5@endymion.delvare \
--to=khali@linux-fr.org \
--cc=broonie@kernel.org \
--cc=broonie@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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
all inboxes | Powered by JetHome®