From: Wei Yongjun Date: Mon, 8 Mar 2021 13:56:19 +0000 (+0000) Subject: PCI: brcmstb: Fix error return code in brcm_pcie_probe() X-Git-Tag: v5.12.5~231 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a81e0a2343204d7d57da4ab96118aecfce3b68c1;p=thirdparty%2Fkernel%2Fstable.git PCI: brcmstb: Fix error return code in brcm_pcie_probe() [ Upstream commit b5d9209d50838474fc1b2901d0e11bba59906428 ] Fix to return negative error code -ENODEV from the unsupported revision error handling case instead of 0, as done elsewhere in this function. Link: https://lore.kernel.org/r/20210308135619.19133-1-weiyongjun1@huawei.com Fixes: 0cdfaceb9889 ("PCI: brcmstb: support BCM4908 with external PERST# signal controller") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Signed-off-by: Lorenzo Pieralisi Reviewed-by: Krzysztof WilczyƄski Acked-by: Florian Fainelli Signed-off-by: Sasha Levin --- diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index e330e6811f0b6..69c999222cc82 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -1296,6 +1296,7 @@ static int brcm_pcie_probe(struct platform_device *pdev) pcie->hw_rev = readl(pcie->base + PCIE_MISC_REVISION); if (pcie->type == BCM4908 && pcie->hw_rev >= BRCM_PCIE_HW_REV_3_20) { dev_err(pcie->dev, "hardware revision with unsupported PERST# setup\n"); + ret = -ENODEV; goto fail; }