patch-2.1.51 linux/arch/sparc64/kernel/ioport.c

Next file: linux/arch/sparc64/kernel/irq.c
Previous file: linux/arch/sparc64/kernel/ioctl32.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.50/linux/arch/sparc64/kernel/ioport.c linux/arch/sparc64/kernel/ioport.c
@@ -1,4 +1,4 @@
-/* $Id: ioport.c,v 1.11 1997/07/22 06:14:04 davem Exp $
+/* $Id: ioport.c,v 1.12 1997/08/08 05:07:02 davem Exp $
  * ioport.c:  Simple io mapping allocator.
  *
  * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
@@ -45,7 +45,7 @@
 		      u32 bus_type, int rdonly)
 {
 	unsigned long vaddr, base_address;
-	unsigned long addr = ((unsigned long) address) + (((unsigned long) bus_type) << 32);
+	unsigned long addr = ((unsigned long)address) + (((unsigned long)bus_type)<<32);
 	unsigned long offset = (addr & (~PAGE_MASK));
 
 	if (virtual) {
@@ -64,7 +64,12 @@
 		/* Tell Linux resource manager about the mapping */
 		request_region ((vaddr | offset), len, name);
 	} else {
-		return __va(addr);
+		unsigned long vaddr = (unsigned long) __va(addr);
+
+		if(!check_region(vaddr, len))
+			request_region(vaddr, len, name);
+
+		return (void *) vaddr;
 	}
 
 	base_address = vaddr;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov