Commit 6bda5736 authored by David S. Miller's avatar David S. Miller

[SPARC64]: Fix of_ioremap().

Use request_mem_region() if IORESOURCE_MEM.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e83f214e
...@@ -131,8 +131,13 @@ static int of_device_resume(struct device * dev) ...@@ -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) void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name)
{ {
unsigned long ret = res->start + offset; 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; ret = 0;
return (void __iomem *) ret; return (void __iomem *) ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment