瀏覽代碼

sh: Make iounmap_fixed() return success/failure for iounmap() path.

This converts iounmap_fixed() to return success/error if it handled the
unmap request or not. At the same time, drop the __init label, as this
can be called in to later.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt 15 年之前
父節點
當前提交
4f744affc3
共有 2 個文件被更改,包括 10 次插入4 次删除
  1. 3 2
      arch/sh/include/asm/io.h
  2. 7 2
      arch/sh/mm/ioremap_fixed.c

+ 3 - 2
arch/sh/include/asm/io.h

@@ -22,6 +22,7 @@
  * for old compat code for I/O offseting to SuperIOs, all of which are
  * for old compat code for I/O offseting to SuperIOs, all of which are
  * better handled through the machvec ioport mapping routines these days.
  * better handled through the machvec ioport mapping routines these days.
  */
  */
+#include <linux/errno.h>
 #include <asm/cache.h>
 #include <asm/cache.h>
 #include <asm/system.h>
 #include <asm/system.h>
 #include <asm/addrspace.h>
 #include <asm/addrspace.h>
@@ -239,7 +240,7 @@ void __iounmap(void __iomem *addr);
 
 
 #ifdef CONFIG_IOREMAP_FIXED
 #ifdef CONFIG_IOREMAP_FIXED
 extern void __iomem *ioremap_fixed(resource_size_t, unsigned long, pgprot_t);
 extern void __iomem *ioremap_fixed(resource_size_t, unsigned long, pgprot_t);
-extern void iounmap_fixed(void __iomem *);
+extern int iounmap_fixed(void __iomem *);
 extern void ioremap_fixed_init(void);
 extern void ioremap_fixed_init(void);
 #else
 #else
 static inline void __iomem *
 static inline void __iomem *
@@ -249,7 +250,7 @@ ioremap_fixed(resource_size t phys_addr, unsigned long size, pgprot_t prot)
 }
 }
 
 
 static inline void ioremap_fixed_init(void) { }
 static inline void ioremap_fixed_init(void) { }
-static inline void iounmap_fixed(void __iomem *addr) { }
+static inline int iounmap_fixed(void __iomem *addr) { return -EINVAL; }
 #endif
 #endif
 
 
 static inline void __iomem *
 static inline void __iomem *

+ 7 - 2
arch/sh/mm/ioremap_fixed.c

@@ -103,7 +103,7 @@ ioremap_fixed(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
 	return map->addr;
 	return map->addr;
 }
 }
 
 
-void __init iounmap_fixed(void __iomem *addr)
+int iounmap_fixed(void __iomem *addr)
 {
 {
 	enum fixed_addresses idx;
 	enum fixed_addresses idx;
 	unsigned long virt_addr;
 	unsigned long virt_addr;
@@ -122,8 +122,11 @@ void __init iounmap_fixed(void __iomem *addr)
 		}
 		}
 	}
 	}
 
 
+	/*
+	 * If we don't match, it's not for us.
+	 */
 	if (slot < 0)
 	if (slot < 0)
-		return;
+		return -EINVAL;
 
 
 	virt_addr = (unsigned long)addr;
 	virt_addr = (unsigned long)addr;
 
 
@@ -141,4 +144,6 @@ void __init iounmap_fixed(void __iomem *addr)
 
 
 	map->size = 0;
 	map->size = 0;
 	map->addr = NULL;
 	map->addr = NULL;
+
+	return 0;
 }
 }