From: Lee Jones <lee.jones@linaro.org>
To: weiyj_lk@163.com
Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] mfd: hi655x: Fix return value check in hi655x_pmic_probe()
Date: Tue, 28 Jun 2016 16:25:29 +0100 [thread overview]
Message-ID: <20160628152529.GA29166@dell> (raw)
In-Reply-To: <1466270767-3888-1-git-send-email-weiyj_lk@163.com>
On Sat, 18 Jun 2016, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function devm_ioremap_resource() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR(). Also remove unneeded error handling of
> platform_get_resource().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
> drivers/mfd/hi655x-pmic.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
Applied, thanks.
> diff --git a/drivers/mfd/hi655x-pmic.c b/drivers/mfd/hi655x-pmic.c
> index 05ddc78..58bf149 100644
> --- a/drivers/mfd/hi655x-pmic.c
> +++ b/drivers/mfd/hi655x-pmic.c
> @@ -80,12 +80,9 @@ static int hi655x_pmic_probe(struct platform_device *pdev)
> pmic->dev = dev;
>
> pmic->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!pmic->res)
> - return -ENOENT;
> -
> base = devm_ioremap_resource(dev, pmic->res);
> - if (!base)
> - return -ENOMEM;
> + if (IS_ERR(base))
> + return PTR_ERR(base);
>
> pmic->regmap = devm_regmap_init_mmio_clk(dev, NULL, base,
> &hi655x_regmap_config);
>
>
>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
prev parent reply other threads:[~2016-06-28 15:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-18 17:26 [PATCH -next] mfd: hi655x: Fix return value check in hi655x_pmic_probe() weiyj_lk
2016-06-28 15:25 ` Lee Jones [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=20160628152529.GA29166@dell \
--to=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=weiyj_lk@163.com \
--cc=yongjun_wei@trendmicro.com.cn \
/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