From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752185AbcBFPkK (ORCPT ); Sat, 6 Feb 2016 10:40:10 -0500 Received: from arrakis.dune.hu ([78.24.191.176]:58303 "EHLO arrakis.dune.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751174AbcBFPkI (ORCPT ); Sat, 6 Feb 2016 10:40:08 -0500 Subject: Re: [PATCH] MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe() To: weiyj_lk@163.com, Ralf Baechle , Matthias Brugger References: <1454768659-32720-1-git-send-email-weiyj_lk@163.com> Cc: linux-mips@linux-mips.org, Wei Yongjun , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org From: John Crispin Message-ID: <56B613D3.2070709@openwrt.org> Date: Sat, 6 Feb 2016 16:40:03 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454768659-32720-1-git-send-email-weiyj_lk@163.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/02/2016 15: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 Hi, thanks for the fix. Acked-by: John Crispin @Ralf: can you merge this via LMO with the next PR please ? @mbgg: ignore the patch please it is for the legacy MIPS SoCs John > --- > arch/mips/pci/pci-mt7620.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/mips/pci/pci-mt7620.c b/arch/mips/pci/pci-mt7620.c > index a009ee4..044c1cd 100644 > --- a/arch/mips/pci/pci-mt7620.c > +++ b/arch/mips/pci/pci-mt7620.c > @@ -297,12 +297,12 @@ static int mt7620_pci_probe(struct platform_device *pdev) > return PTR_ERR(rstpcie0); > > bridge_base = devm_ioremap_resource(&pdev->dev, bridge_res); > - if (!bridge_base) > - return -ENOMEM; > + if (IS_ERR(bridge_base)) > + return PTR_ERR(bridge_base); > > pcie_base = devm_ioremap_resource(&pdev->dev, pcie_res); > - if (!pcie_base) > - return -ENOMEM; > + if (IS_ERR(pcie_base)) > + return PTR_ERR(pcie_base); > > iomem_resource.start = 0; > iomem_resource.end = ~0; > > > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek >