From: David S. Miller Date: Thu, 19 Oct 2006 06:00:35 +0000 (-0700) Subject: [SPARC64]: Fix of_ioremap(). X-Git-Tag: v2.6.19-rc3~44^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bda57365a5fda4743d83a5987c6aab66e90771c;p=linux-2.6 [SPARC64]: Fix of_ioremap(). Use request_mem_region() if IORESOURCE_MEM. Signed-off-by: David S. Miller --- diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c index d822c7c18e..d3dfb2a36d 100644 --- a/arch/sparc64/kernel/of_device.c +++ b/arch/sparc64/kernel/of_device.c @@ -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;