mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
checks: add string list check for *-names properties
Add a string list check for common properties ending in "-names" such as reg-names or interrupt-names. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
8fe94fd6f1
commit
18a3d84bb8
3 changed files with 19 additions and 2 deletions
18
checks.c
18
checks.c
|
@ -620,6 +620,22 @@ WARNING_IF_NOT_STRING(label_is_string, "label");
|
|||
|
||||
WARNING_IF_NOT_STRING_LIST(compatible_is_string_list, "compatible");
|
||||
|
||||
static void check_names_is_string_list(struct check *c, struct dt_info *dti,
|
||||
struct node *node)
|
||||
{
|
||||
struct property *prop;
|
||||
|
||||
for_each_property(node, prop) {
|
||||
const char *s = strrchr(prop->name, '-');
|
||||
if (!s || !streq(s, "-names"))
|
||||
continue;
|
||||
|
||||
c->data = prop->name;
|
||||
check_is_string_list(c, dti, node);
|
||||
}
|
||||
}
|
||||
WARNING(names_is_string_list, check_names_is_string_list, NULL);
|
||||
|
||||
static void fixup_addr_size_cells(struct check *c, struct dt_info *dti,
|
||||
struct node *node)
|
||||
{
|
||||
|
@ -1271,7 +1287,7 @@ static struct check *check_table[] = {
|
|||
&device_type_is_string, &model_is_string, &status_is_string,
|
||||
&label_is_string,
|
||||
|
||||
&compatible_is_string_list,
|
||||
&compatible_is_string_list, &names_is_string_list,
|
||||
|
||||
&property_name_chars_strict,
|
||||
&node_name_chars_strict,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue