From patchwork Sat Feb 6 14:24:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiyj_lk@163.com X-Patchwork-Id: 8242551 Return-Path: X-Original-To: patchwork-linux-mediatek@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BA4EEBEEE5 for ; Sat, 6 Feb 2016 14:25:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B72AC20123 for ; Sat, 6 Feb 2016 14:25:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FC082010C for ; Sat, 6 Feb 2016 14:25:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aS3nX-0007Sn-6g; Sat, 06 Feb 2016 14:25:15 +0000 Received: from m12-17.163.com ([220.181.12.17]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aS3nM-0006BH-5w; Sat, 06 Feb 2016 14:25:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=oQPml OEAIMPEqK7gb+0HInc3B5AVq7mUmsB6xDdaTaw=; b=QORrM8sd8H4XflIX/ptXN Rv2IuJ7TIla4kiacwlKUxrrPv9pvESzArJh5BP6Zpk2yYUrYvVijAxHtlQoikGqN UVjj3qk6ehwmD+wejl87702gk47gL0cza8gi8aWFM3VgklCgAvg4jwkGqWJY9QxA hJydeRrxZh9O7tJNeP0bKU= Received: from localhost.localdomain.localdomain (unknown [49.77.206.103]) by smtp13 (Coremail) with SMTP id EcCowAAXTnYfArZW3M2kAw--.40432S2; Sat, 06 Feb 2016 22:24:33 +0800 (CST) From: weiyj_lk@163.com To: Ralf Baechle , Matthias Brugger , John Crispin Subject: [PATCH] MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe() Date: Sat, 6 Feb 2016 22:24:19 +0800 Message-Id: <1454768659-32720-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.4.3 MIME-Version: 1.0 X-CM-TRANSID: EcCowAAXTnYfArZW3M2kAw--.40432S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4kAFWDXryfuF1fuFyDWrg_yoWDKrgEv3 90krn7JrZ3JFyYqay2yry5CFy3Aa4qgr9Igr4vgay3Aryrury3KFW7ur9rAF4ru39xKrWq 9rZxGr47ur43AjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnxMaUUUUUU== X-Originating-IP: [49.77.206.103] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiowAH1lUL4agH2gAAs4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160206_062504_530361_A0C35FC6 X-CRM114-Status: UNSURE ( 7.20 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.4 (--) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mips@linux-mips.org, Wei Yongjun , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: John Crispin --- 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;