Browse Source

checks: add aliases node checks

Add checks for aliases node that all properties follow alias naming
convention and the values are a valid path.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Rob Herring 7 years ago committed by David Gibson
parent
commit
e671852042
  1. 24
      checks.c

24
checks.c

@ -636,6 +636,28 @@ static void check_names_is_string_list(struct check *c, struct dt_info *dti, @@ -636,6 +636,28 @@ static void check_names_is_string_list(struct check *c, struct dt_info *dti,
}
WARNING(names_is_string_list, check_names_is_string_list, NULL);

static void check_alias_paths(struct check *c, struct dt_info *dti,
struct node *node)
{
struct property *prop;

if (!streq(node->name, "aliases"))
return;

for_each_property(node, prop) {
if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) {
FAIL(c, dti, "aliases property '%s' is not a valid node (%s)",
prop->name, prop->val.val);
continue;
}
if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name))
FAIL(c, dti, "aliases property name '%s' is not valid",
prop->name);

}
}
WARNING(alias_paths, check_alias_paths, NULL);

static void fixup_addr_size_cells(struct check *c, struct dt_info *dti,
struct node *node)
{
@ -1354,6 +1376,8 @@ static struct check *check_table[] = { @@ -1354,6 +1376,8 @@ static struct check *check_table[] = {
&gpios_property,
&interrupts_property,

&alias_paths,

&always_fail,
};


Loading…
Cancel
Save