]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/prom.c
Merge branch 'irq-fixes' of git://git.parisc-linux.org/git/linux-2.6
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / prom.c
index bf2005b2feb61dedab2203d0e958b12890f9df54..865b9648d0d57057fe1af797d67d6faea5345459 100644 (file)
@@ -724,7 +724,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
                strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE));
 
 #ifdef CONFIG_CMDLINE
-       if (l == 0 || (l == 1 && (*p) == 0))
+       if (p == NULL || l == 0 || (l == 1 && (*p) == 0))
                strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
 #endif /* CONFIG_CMDLINE */
 
@@ -757,24 +757,9 @@ static int __init early_init_dt_scan_root(unsigned long node,
 static unsigned long __init dt_mem_next_cell(int s, cell_t **cellp)
 {
        cell_t *p = *cellp;
-       unsigned long r;
 
-       /* Ignore more than 2 cells */
-       while (s > sizeof(unsigned long) / 4) {
-               p++;
-               s--;
-       }
-       r = *p++;
-#ifdef CONFIG_PPC64
-       if (s > 1) {
-               r <<= 32;
-               r |= *(p++);
-               s--;
-       }
-#endif
-
-       *cellp = p;
-       return r;
+       *cellp = p + s;
+       return of_read_ulong(p, s);
 }