From: Viresh Kumar <viresh.kumar@linaro.org>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>, linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/2] cpufreq: imx: fix regulator_get error handling
Date: Sun, 18 Oct 2015 21:25:09 +0530 [thread overview]
Message-ID: <20151018155509.GD19018@linux> (raw)
In-Reply-To: <56237C1C.80109@gmail.com>
On 18-10-15, 13:01, Heiner Kallweit wrote:
> arm_reg = regulator_get(cpu_dev, "arm");
> + if (IS_ERR(arm_reg)) {
> + ret = PTR_ERR(arm_reg);
> + if (ret != -EPROBE_DEFER)
> + dev_err(cpu_dev, "failed to get regulator arm\n");
> + goto put_reg;
So you will error out even for other errors, but that wasn't the case
earlier. Are you sure this is what you want?
> + }
> +
> pu_reg = regulator_get_optional(cpu_dev, "pu");
Why don't we do error checking for this as well ?
> +
> soc_reg = regulator_get(cpu_dev, "soc");
> - if (IS_ERR(arm_reg) || IS_ERR(soc_reg)) {
> - dev_err(cpu_dev, "failed to get regulators\n");
> - ret = -ENOENT;
> + if (IS_ERR(soc_reg)) {
> + ret = PTR_ERR(soc_reg);
> + if (ret != -EPROBE_DEFER)
> + dev_err(cpu_dev, "failed to get regulator soc\n");
> goto put_reg;
> }
>
> --
> 2.6.1
--
viresh
next prev parent reply other threads:[~2015-10-18 15:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-18 11:01 [PATCH 1/2] cpufreq: imx: fix regulator_get error handling Heiner Kallweit
2015-10-18 15:55 ` Viresh Kumar [this message]
2015-10-18 16:40 ` Heiner Kallweit
2015-10-18 16:46 ` Viresh Kumar
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=20151018155509.GD19018@linux \
--to=viresh.kumar@linaro.org \
--cc=hkallweit1@gmail.com \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.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;
as well as URLs for NNTP newsgroup(s).