diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2016-02-06 09:24:19 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2016-02-10 04:01:44 -0500 |
commit | aaa0bf22cb84c7b29c814f3fcf3951c747b904d6 (patch) | |
tree | 94f6ede10c73514b2fa695a2c5fb8259736b69ed | |
parent | 3af5a67c86a30f8cd8bfd6202709be21cedd2756 (diff) |
MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe()
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 <yongjun_wei@trendmicro.com.cn>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/12451/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/pci/pci-mt7620.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/mips/pci/pci-mt7620.c b/arch/mips/pci/pci-mt7620.c index a009ee458934..1ae932c2d78b 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) | |||
297 | return PTR_ERR(rstpcie0); | 297 | return PTR_ERR(rstpcie0); |
298 | 298 | ||
299 | bridge_base = devm_ioremap_resource(&pdev->dev, bridge_res); | 299 | bridge_base = devm_ioremap_resource(&pdev->dev, bridge_res); |
300 | if (!bridge_base) | 300 | if (IS_ERR(bridge_base)) |
301 | return -ENOMEM; | 301 | return PTR_ERR(bridge_base); |
302 | 302 | ||
303 | pcie_base = devm_ioremap_resource(&pdev->dev, pcie_res); | 303 | pcie_base = devm_ioremap_resource(&pdev->dev, pcie_res); |
304 | if (!pcie_base) | 304 | if (IS_ERR(pcie_base)) |
305 | return -ENOMEM; | 305 | return PTR_ERR(pcie_base); |
306 | 306 | ||
307 | iomem_resource.start = 0; | 307 | iomem_resource.start = 0; |
308 | iomem_resource.end = ~0; | 308 | iomem_resource.end = ~0; |