Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932375AbcJaQUj (ORCPT ); Mon, 31 Oct 2016 12:20:39 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:60796 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764068AbcJaQUg (ORCPT ); Mon, 31 Oct 2016 12:20:36 -0400 Date: Mon, 31 Oct 2016 16:20:27 +0000 From: Russell King - ARM Linux To: Christophe JAILLET , arm@kernel.org Cc: jun.nie@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] ARM: zx: Fix error handling Message-ID: <20161031162027.GK1041@n2100.armlinux.org.uk> References: <20161030081010.14735-1-christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161030081010.14735-1-christophe.jaillet@wanadoo.fr> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1169 Lines: 35 Same as the other fix... On Sun, Oct 30, 2016 at 09:10:10AM +0100, Christophe JAILLET wrote: > 'devm_ioremap_resource()' returns an error pointer in case of error, not > NULL. So test it with IS_ERR. > > Signed-off-by: Christophe JAILLET > --- > 'return -EIO;' could also be turned into 'return PTR_ERR(pcubase);' in > order to propagate the error value. > --- > arch/arm/mach-zx/zx296702-pm-domain.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c > index e08574d4e2ca..79dcf2549267 100644 > --- a/arch/arm/mach-zx/zx296702-pm-domain.c > +++ b/arch/arm/mach-zx/zx296702-pm-domain.c > @@ -169,7 +169,7 @@ 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; > } > -- > 2.9.3 > -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.