mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
dtc: Simplify error handling for unparseable input
Currently, main() tests if it got a valid input tree from whichever dt_from_*() function it invoked and if not, die()s. For one thing, this test has, for no good reason, three different ways for those functions to communicate a failure to provide input (bi NULL, bi->dt NULL, or bi->error non-zero). For another, in every case save one, if the dt_from_*() functions are unable to provide input they will immediately die() (with a more specific error message) rather than proceeding to the test in main(). Therefore, this patch removes this test, making the one case that could have triggered it (in dt_from_source()) call die() directly instead. With this change, the error field in struct boot_info is now unused, so remove it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
1577696b6d
commit
35aa1a273b
4 changed files with 4 additions and 7 deletions
3
dtc.c
3
dtc.c
|
@ -201,9 +201,6 @@ int main(int argc, char *argv[])
|
|||
if (inf && inf->file != stdin)
|
||||
fclose(inf->file);
|
||||
|
||||
if (! bi || ! bi->dt || bi->error)
|
||||
die("Couldn't read input tree\n");
|
||||
|
||||
fill_fullpaths(bi->dt, "");
|
||||
process_checks(force, bi);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue