From: jonghwa3.lee@samsung.com
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: anton.vorontsov@linaro.org, linux-kernel@vger.kernel.org,
Myungjoo Ham <myungjoo.ham@samsung.com>
Subject: Re: [PATCH 1/2] power: charger-manager: regulator_get() never returns NULL.
Date: Tue, 25 Jun 2013 14:09:27 +0900 [thread overview]
Message-ID: <51C92607.7050403@samsung.com> (raw)
In-Reply-To: <CAK9yfHxLDiu7tagRhPEK1aCCTYnMH7i2yKrtqquAwnfxHnZxSg@mail.gmail.com>
On 2013년 06월 25일 14:07, Sachin Kamat wrote:
> On 25 June 2013 10:32, Jonghwa Lee <jonghwa3.lee@samsung.com> wrote:
>> This patch fixes return value checking of regulator_get() in charger-manager
>> driver. The API, regulator_get(), returns ERR_PTR() when it fails to get
>> regulator with given name, not NULL.
>>
>> Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
>> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
>> ---
>> drivers/power/charger-manager.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c
>> index ba42029..7d1bcde 100644
>> --- a/drivers/power/charger-manager.c
>> +++ b/drivers/power/charger-manager.c
>> @@ -1239,7 +1239,7 @@ static int charger_manager_register_extcon(struct charger_manager *cm)
>>
>> charger->consumer = regulator_get(cm->dev,
>> charger->regulator_name);
>> - if (charger->consumer == NULL) {
>> + if (IS_ERR(charger->consumer)) {
>> dev_err(cm->dev, "Cannot find charger(%s)\n",
>> charger->regulator_name);
>> ret = -EINVAL;
>
> You can as well make this ret = PTR_ERR(charger->consumer).
Yes, I'll fix it.
Thanks,
Jonghwa
>
> ---
> With warm regards,
> Sachin
>
prev parent reply other threads:[~2013-06-25 5:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-25 5:02 [PATCH 1/2] power: charger-manager: regulator_get() never returns NULL Jonghwa Lee
2013-06-25 5:02 ` [PATCH 2/2] power: charger-manager: Fix a bug when it unregisters notifier block of extcon Jonghwa Lee
[not found] ` <CAGTfZH1q8b0VyDsSsFa7DooHbLN46PTYofCRXCYRThnuNRjCwg@mail.gmail.com>
2013-06-26 1:19 ` jonghwa3.lee
2013-06-26 1:22 ` Chanwoo Choi
2013-06-25 5:07 ` [PATCH 1/2] power: charger-manager: regulator_get() never returns NULL Sachin Kamat
2013-06-25 5:09 ` jonghwa3.lee [this message]
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=51C92607.7050403@samsung.com \
--to=jonghwa3.lee@samsung.com \
--cc=anton.vorontsov@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=sachin.kamat@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.