[SPARC64]: Fix of_ioremap().
authorDavid S. Miller <davem@sunset.davemloft.net>
Thu, 19 Oct 2006 06:00:35 +0000 (23:00 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 20 Oct 2006 00:20:31 +0000 (17:20 -0700)
Use request_mem_region() if IORESOURCE_MEM.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/of_device.c

index d822c7c18e1f9e5b92ddb8add7ce2bd6586b72ef..d3dfb2a36d477584d8722430e07f01f701f9f01a 100644 (file)
@@ -131,8 +131,13 @@ static int of_device_resume(struct device * dev)
 void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name)
 {
        unsigned long ret = res->start + offset;
+       struct resource *r;
 
-       if (!request_region(ret, size, name))
+       if (res->flags & IORESOURCE_MEM)
+               r = request_mem_region(ret, size, name);
+       else
+               r = request_region(ret, size, name);
+       if (!r)
                ret = 0;
 
        return (void __iomem *) ret;