Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aaa0bf22 authored by Wei Yongjun's avatar Wei Yongjun Committed by Ralf Baechle
Browse files

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarJohn 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: default avatarRalf Baechle <ralf@linux-mips.org>
parent 3af5a67c
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -297,12 +297,12 @@ static int mt7620_pci_probe(struct platform_device *pdev)
		return PTR_ERR(rstpcie0);
		return PTR_ERR(rstpcie0);


	bridge_base = devm_ioremap_resource(&pdev->dev, bridge_res);
	bridge_base = devm_ioremap_resource(&pdev->dev, bridge_res);
	if (!bridge_base)
	if (IS_ERR(bridge_base))
		return -ENOMEM;
		return PTR_ERR(bridge_base);


	pcie_base = devm_ioremap_resource(&pdev->dev, pcie_res);
	pcie_base = devm_ioremap_resource(&pdev->dev, pcie_res);
	if (!pcie_base)
	if (IS_ERR(pcie_base))
		return -ENOMEM;
		return PTR_ERR(pcie_base);


	iomem_resource.start = 0;
	iomem_resource.start = 0;
	iomem_resource.end = ~0;
	iomem_resource.end = ~0;