]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PCI: mvebu: return NULL instead of ERR_PTR(ret)
authorJingoo Han <jg1.han@samsung.com>
Tue, 15 Oct 2013 09:12:07 +0000 (18:12 +0900)
committerJason Cooper <jason@lakedaemon.net>
Thu, 17 Oct 2013 13:03:54 +0000 (13:03 +0000)
Return NULL instead of ERR_PTR(ret) in order to fix the following
sparse warning:

drivers/pci/host/pci-mvebu.c:744:31: warning: incorrect type in return expression (different address
spaces)
drivers/pci/host/pci-mvebu.c:744:31:    expected void [noderef] <asn:2>*
drivers/pci/host/pci-mvebu.c:744:31:    got void *

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
drivers/pci/host/pci-mvebu.c

index 80b2250ea19a6f892e3645e8736216c7dd96aafd..322bdba4b37ae1b5d03b5f80c33ff5d2c3678148 100644 (file)
@@ -753,7 +753,7 @@ static void __iomem *mvebu_pcie_map_registers(struct platform_device *pdev,
 
        ret = of_address_to_resource(np, 0, &regs);
        if (ret)
-               return ERR_PTR(ret);
+               return NULL;
 
        return devm_ioremap_resource(&pdev->dev, &regs);
 }
@@ -952,10 +952,9 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
                        continue;
 
                port->base = mvebu_pcie_map_registers(pdev, child, port);
-               if (IS_ERR(port->base)) {
+               if (!port->base) {
                        dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
                                port->port, port->lane);
-                       port->base = NULL;
                        clk_disable_unprepare(port->clk);
                        continue;
                }