From 169f0b183d45b87ba6dfc194792aee6170ffb54d Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 18 Oct 2007 17:22:30 +1000 Subject: dtc: Disable semantic checks by default At present, dtc makes a lot of semantic checks on the device tree by default, and will refuse to produce output if they fail. This means people tend to need -f to force output despite failing semantic checks rather a lot. This patch splits the device tree checks into structural checks (no bad or duplicate names or phandles) and semantic checks (everything else). By default, only the structural checks are performed, and are fatal. -f will force output even with structural errors (using this in -Idts mode would essentially always be a bad idea, but it might be useful in -Idtb mode for examining a malformed dtb). Semantic checks are only performed if the new -c command line option is supplied, and are always warnings only. Semantic checks will never be performed on a tree with structural errors. This patch is only a stopgap before implementing proper fine-grained error/warning handling, but it should at least get rid of the far-too-frequent need for -f for the time being. This patch removes the -f from the dtc testcases now that it's no longer necessary. Signed-off-by: David Gibson --- dtc.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dtc.h') diff --git a/dtc.h b/dtc.h index 09dec54..77494af 100644 --- a/dtc.h +++ b/dtc.h @@ -188,6 +188,10 @@ struct node *chain_node(struct node *first, struct node *list); void add_property(struct node *node, struct property *prop); void add_child(struct node *parent, struct node *child); +int check_structure(struct node *dt); +void fixup_references(struct node *dt); +int check_semantics(struct node *dt, int outversion, int boot_cpuid_phys); + int check_device_tree(struct node *dt, int outversion, int boot_cpuid_phys); /* Boot info (tree plus memreserve information */ -- cgit v1.2.1