]> git.karo-electronics.de Git - linux-beck.git/commitdiff
PCI: altera: Remove redundant platform_get_resource() return value check
authorBjorn Helgaas <bhelgaas@google.com>
Mon, 22 Aug 2016 19:12:11 +0000 (14:12 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 12 Sep 2016 21:54:17 +0000 (16:54 -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.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/host/pcie-altera-msi.c

index 99177f4ccde286b29ac7c61977fab444065f827a..0629ae172b550cd95f73af842d4dbcacec3a103e 100644 (file)
@@ -237,11 +237,6 @@ static int altera_msi_probe(struct platform_device *pdev)
        msi->pdev = pdev;
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "csr");
-       if (!res) {
-               dev_err(&pdev->dev, "no csr memory resource defined\n");
-               return -ENODEV;
-       }
-
        msi->csr_base = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(msi->csr_base)) {
                dev_err(&pdev->dev, "failed to map csr memory\n");
@@ -250,11 +245,6 @@ static int altera_msi_probe(struct platform_device *pdev)
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
                                           "vector_slave");
-       if (!res) {
-               dev_err(&pdev->dev, "no vector_slave memory resource defined\n");
-               return -ENODEV;
-       }
-
        msi->vector_base = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(msi->vector_base)) {
                dev_err(&pdev->dev, "failed to map vector_slave memory\n");