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>
ret = of_address_to_resource(np, 0, ®s);
if (ret)
- return ERR_PTR(ret);
+ return NULL;
return devm_ioremap_resource(&pdev->dev, ®s);
}
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;
}