Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[pandora-kernel.git] / arch / um / kernel / physmem.c
index 0e65340..166cb09 100644 (file)
@@ -9,6 +9,7 @@
 #include "linux/vmalloc.h"
 #include "linux/bootmem.h"
 #include "linux/module.h"
+#include "linux/pfn.h"
 #include "asm/types.h"
 #include "asm/pgtable.h"
 #include "kern_util.h"
@@ -68,7 +69,7 @@ static void insert_phys_mapping(struct phys_desc *desc)
                panic("Physical remapping for %p already present",
                      desc->virt);
 
-       rb_link_node(&desc->rb, (*n)->rb_parent, n);
+       rb_link_node(&desc->rb, rb_parent(*n), n);
        rb_insert_color(&desc->rb, &phys_mappings);
 }
 
@@ -316,8 +317,6 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len,
        }
 }
 
-#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
-
 extern int __syscall_stub_start, __binary_start;
 
 void setup_physmem(unsigned long start, unsigned long reserve_end,
@@ -408,6 +407,8 @@ unsigned long find_iomem(char *driver, unsigned long *len_out)
                        *len_out = region->size;
                        return(region->virt);
                }
+
+               region = region->next;
        }
 
        return(0);