From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756578AbcBIFDw (ORCPT ); Tue, 9 Feb 2016 00:03:52 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:35446 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754552AbcBIFCS (ORCPT ); Tue, 9 Feb 2016 00:02:18 -0500 Subject: Re: [PATCH] ARM: zx: Fix return value check in zx296702_pd_probe() To: weiyj_lk@163.com, Russell King References: <1454768696-340-1-git-send-email-weiyj_lk@163.com> Cc: Wei Yongjun , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org From: Jun Nie Message-ID: <56B972D4.8040608@linaro.org> Date: Tue, 9 Feb 2016 13:02:12 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454768696-340-1-git-send-email-weiyj_lk@163.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016年02月06日 22:24, weiyj_lk@163.com wrote: > From: Wei Yongjun > > 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(). > > Signed-off-by: Wei Yongjun > --- > arch/arm/mach-zx/zx296702-pm-domain.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c > index e08574d..2037bcb 100644 > --- a/arch/arm/mach-zx/zx296702-pm-domain.c > +++ b/arch/arm/mach-zx/zx296702-pm-domain.c > @@ -169,9 +169,9 @@ static int zx296702_pd_probe(struct platform_device *pdev) > } > > pcubase = devm_ioremap_resource(&pdev->dev, res); > - if (!pcubase) { > + if (IS_ERR(pcubase)) { > dev_err(&pdev->dev, "ioremap fail.\n"); > - return -EIO; > + return PTR_ERR(pcubase); > } > > for (i = 0; i < ARRAY_SIZE(zx296702_pm_domains); ++i) > Thanks for fixing this issue. Reviewed-by: Jun Nie