From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752170AbcBFO0u (ORCPT ); Sat, 6 Feb 2016 09:26:50 -0500 Received: from m12-17.163.com ([220.181.12.17]:41792 "EHLO m12-17.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751923AbcBFO0T (ORCPT ); Sat, 6 Feb 2016 09:26:19 -0500 From: weiyj_lk@163.com To: Jun Nie , Russell King Cc: Wei Yongjun , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: zx: Fix return value check in zx296702_pd_probe() Date: Sat, 6 Feb 2016 22:24:56 +0800 Message-Id: <1454768696-340-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.4.3 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-CM-TRANSID: EcCowABHf3c+ArZWFdSkAw--.46735S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4kAFWDXryfuF1DJw4Utwb_yoWDJrXEy3 9I9wn7GFnayF129ryjkw45WrZxW3Z8KFnFg34jk34ayFWj9w1xCFZ0grnaqF43Z3ykKr4f AFZxZr4akrnFyjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnBOJ5UUUUU== X-Originating-IP: [49.77.206.103] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiNR4H1lSIL23LPgAAsR Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)