From: Heiner Kallweit <hkallweit1@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
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 18:40:45 +0200 [thread overview]
Message-ID: <5623CB8D.2020405@gmail.com> (raw)
In-Reply-To: <20151018155509.GD19018@linux>
Am 18.10.2015 um 17:55 schrieb Viresh Kumar:
> 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?
>
This was the case before as well (just the error handling for
arm-reg and soc_reg was combined).
The only difference is that before all errors were mapped to
-ENOENT and now the actual error code is forwarded.
>> + }
>> +
>> pu_reg = regulator_get_optional(cpu_dev, "pu");
>
> Why don't we do error checking for this as well ?
>
Please see patch 2/2. I separated it because it doeas a little bit
more than handling -EPROBE_DEFER.
>> +
>> 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
>
next prev parent reply other threads:[~2015-10-18 16:40 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
2015-10-18 16:40 ` Heiner Kallweit [this message]
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=5623CB8D.2020405@gmail.com \
--to=hkallweit1@gmail.com \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=viresh.kumar@linaro.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.