PCI: designware: Remove redundant platform_get_resource() return value check
authorWei Yongjun <weiyj.lk@gmail.com>
Thu, 28 Jul 2016 16:14:54 +0000 (16:14 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 23 Aug 2016 21:55:18 +0000 (16:55 -0500)
devm_ioremap_resource() fails gracefully when given a NULL resource
pointer, so we don't need to check separately for failure from
platform_get_resource_byname().  Remove the redundant check.

[bhelgaas: changelog]
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/host/pcie-designware-plat.c

index c8079dc81c1000c377751ab27593aa7ca16fc2f9..17da005497a5cd5f402b95a9c28a291860783f28 100644 (file)
@@ -100,9 +100,6 @@ static int dw_plat_pcie_probe(struct platform_device *pdev)
        pp->dev = &pdev->dev;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res)
-               return -ENODEV;
-
        dw_plat_pcie->mem_base = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(dw_plat_pcie->mem_base))
                return PTR_ERR(dw_plat_pcie->mem_base);