X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=arch%2Fpowerpc%2Fboot%2Fdtc-src%2Ftreesource.c;h=ebeb6eb27907db69cd113ba0de8fa9dfd856d25f;hb=ed95d7450dcbfeb45ffc9d39b1747aee82b49a51;hp=a6a7767976364498a99b1a3c6c7d4d8f6071446a;hpb=0ec27c049d80535f77901654a310b090106b046c;p=linux-2.6-omap-h63xx.git diff --git a/arch/powerpc/boot/dtc-src/treesource.c b/arch/powerpc/boot/dtc-src/treesource.c index a6a77679763..ebeb6eb2790 100644 --- a/arch/powerpc/boot/dtc-src/treesource.c +++ b/arch/powerpc/boot/dtc-src/treesource.c @@ -23,20 +23,23 @@ extern FILE *yyin; extern int yyparse(void); -extern void yyerror(char const *); struct boot_info *the_boot_info; +int treesource_error; struct boot_info *dt_from_source(const char *fname) { the_boot_info = NULL; + treesource_error = 0; - push_input_file(fname); + srcpos_file = dtc_open_file(fname, NULL); + yyin = srcpos_file->file; if (yyparse() != 0) - return NULL; + die("Unable to parse input tree\n"); - fill_fullpaths(the_boot_info->dt, ""); + if (treesource_error) + die("Syntax error parsing input tree\n"); return the_boot_info; } @@ -144,7 +147,7 @@ static void write_propval_cells(FILE *f, struct data val) m = m->next; } - fprintf(f, "0x%x", be32_to_cpu(*cp++)); + fprintf(f, "0x%x", fdt32_to_cpu(*cp++)); if ((void *)cp >= propend) break; fprintf(f, " "); @@ -173,7 +176,7 @@ static void write_propval_bytes(FILE *f, struct data val) } fprintf(f, "%02hhx", *bp++); - if ((void *)bp >= propend) + if ((const void *)bp >= propend) break; fprintf(f, " "); }