]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/sparc64/kernel/of_device.c
[SPARC64]: Fix of_iounmap() region release.
[mirror_ubuntu-bionic-kernel.git] / arch / sparc64 / kernel / of_device.c
index cec0eceae552acab1b561abb58b7cfa00aeebd38..b0f3e0082a0da113fc31eedb484c44ae5c10a9b7 100644 (file)
@@ -144,9 +144,12 @@ void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned lo
 }
 EXPORT_SYMBOL(of_ioremap);
 
-void of_iounmap(void __iomem *base, unsigned long size)
+void of_iounmap(struct resource *res, void __iomem *base, unsigned long size)
 {
-       release_region((unsigned long) base, size);
+       if (res->flags & IORESOURCE_MEM)
+               release_mem_region((unsigned long) base, size);
+       else
+               release_region((unsigned long) base, size);
 }
 EXPORT_SYMBOL(of_iounmap);