s390: unify identity mapping limits handling
[linux-2.6-microblaze.git] / arch / s390 / boot / mem_detect.c
index 62e7c13..40168e5 100644 (file)
@@ -8,7 +8,6 @@
 #include "compressed/decompressor.h"
 #include "boot.h"
 
-unsigned long __bootdata(max_physmem_end);
 struct mem_detect_info __bootdata(mem_detect);
 
 /* up to 256 storage elements, 1020 subincrements each */
@@ -149,27 +148,29 @@ static void search_mem_end(void)
        add_mem_detect_block(0, (offset + 1) << 20);
 }
 
-void detect_memory(void)
+unsigned long detect_memory(void)
 {
+       unsigned long max_physmem_end;
+
        sclp_early_get_memsize(&max_physmem_end);
 
        if (!sclp_early_read_storage_info()) {
                mem_detect.info_source = MEM_DETECT_SCLP_STOR_INFO;
-               return;
+               return max_physmem_end;
        }
 
        if (!diag260()) {
                mem_detect.info_source = MEM_DETECT_DIAG260;
-               return;
+               return max_physmem_end;
        }
 
        if (max_physmem_end) {
                add_mem_detect_block(0, max_physmem_end);
                mem_detect.info_source = MEM_DETECT_SCLP_READ_INFO;
-               return;
+               return max_physmem_end;
        }
 
        search_mem_end();
        mem_detect.info_source = MEM_DETECT_BIN_SEARCH;
-       max_physmem_end = get_mem_detect_end();
+       return get_mem_detect_end();
 }