Message ID | 000501ceaf9b$acaec690$060c53b0$%han@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
Dear Jingoo Han, On Thu, 12 Sep 2013 18:37:18 +0900, Jingoo Han wrote: > ret = of_address_to_resource(np, 0, ®s); > if (ret) > - return ERR_PTR(ret); > + return (void __iomem *)ERR_PTR(ret); This doesn't look very pretty to tell the truth, but I don't quite see any other option. Just return NULL when of_address_to_resource() fails instead of trying to propagate the error? Make this entire function return an 'int' and have the iomem address returned through a pointer passed by address as argument to the function? Any other suggestion? Thanks, Thomas
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c index b54ceb1..2d8e478 100644 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c @@ -741,7 +741,7 @@ static void __iomem *mvebu_pcie_map_registers(struct platform_device *pdev, ret = of_address_to_resource(np, 0, ®s); if (ret) - return ERR_PTR(ret); + return (void __iomem *)ERR_PTR(ret); return devm_ioremap_resource(&pdev->dev, ®s); }
Added missing __iomem annotation 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> --- drivers/pci/host/pci-mvebu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)