From: Vincenzo Frascino <vincenzo.frascino@st.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Viresh KUMAR <viresh.kumar@st.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: Re: [patch] thermal: spear13xx: checking for NULL instead of IS_ERR()
Date: Wed, 29 Feb 2012 10:02:15 +0100 [thread overview]
Message-ID: <4F4DE997.4050900@st.com> (raw)
In-Reply-To: <20120229063151.GA18031@elgon.mountain>
Thanks Dan.
Il 29/02/2012 07:31, Dan Carpenter ha scritto:
> thermal_zone_device_register() never returns NULL, on error it returns
> and ERR_PTR().
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
> index 880bf28..7352cf8 100644
> --- a/drivers/thermal/spear_thermal.c
> +++ b/drivers/thermal/spear_thermal.c
> @@ -149,9 +149,9 @@ static int spear_thermal_probe(struct platform_device *pdev)
>
> spear_thermal = thermal_zone_device_register("spear_thermal", 0,
> stdev, &ops, 0, 0, 0, 0);
> - if (!spear_thermal) {
> + if (IS_ERR(spear_thermal)) {
> dev_err(&pdev->dev, "thermal zone device is NULL\n");
> - ret = -EINVAL;
> + ret = PTR_ERR(spear_thermal);
> goto disable_clk;
> }
>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@st.com>
prev parent reply other threads:[~2012-02-29 8:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 6:31 [patch] thermal: spear13xx: checking for NULL instead of IS_ERR() Dan Carpenter
2012-02-29 6:34 ` Viresh Kumar
2012-02-29 9:02 ` Vincenzo Frascino [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=4F4DE997.4050900@st.com \
--to=vincenzo.frascino@st.com \
--cc=akpm@linux-foundation.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viresh.kumar@st.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