diff options
author | Steffen Trumtrar <s.trumtrar@pengutronix.de> | 2017-07-10 12:33:53 +0200 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2017-07-11 15:45:20 +0200 |
commit | 8f9f81086fcf9cd91edcad427c0bc8aa7a8b35f4 (patch) | |
tree | 0c133574c40d635c18fe43c355eadd53d805b102 /common | |
parent | b00a9d7b5c8bcce3d08b663b467f0686dc2466d9 (diff) | |
download | barebox-8f9f81086fcf9cd91edcad427c0bc8aa7a8b35f4.tar.gz barebox-8f9f81086fcf9cd91edcad427c0bc8aa7a8b35f4.tar.xz |
blspec: skip all devicetree tests if entry doesn't specify one
If the blspec entry does not specify a devicetree to test against,
it doesn't make any sense to check the compatible of the machine or
find the root node.
Instead of first testing the barebox devicetree check if the entry
specifies one.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/blspec.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/common/blspec.c b/common/blspec.c index 8132d141ab..b258e6600b 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -361,6 +361,14 @@ static bool entry_is_of_compatible(struct blspec_entry *entry) const char *compat; char *filename; + /* If the entry doesn't specifiy a devicetree we are compatible */ + devicetree = blspec_entry_var_get(entry, "devicetree"); + if (!devicetree) + return true; + + if (!strcmp(devicetree, "none")) + return true; + /* If we don't have a root node every entry is compatible */ barebox_root = of_get_root_node(); if (!barebox_root) @@ -375,14 +383,6 @@ static bool entry_is_of_compatible(struct blspec_entry *entry) else abspath = ""; - /* If the entry doesn't specifiy a devicetree we are compatible */ - devicetree = blspec_entry_var_get(entry, "devicetree"); - if (!devicetree) - return true; - - if (!strcmp(devicetree, "none")) - return true; - filename = basprintf("%s/%s", abspath, devicetree); fdt = read_file(filename, &size); |