diff options
author | Rob Herring <robh@kernel.org> | 2017-09-01 13:53:01 -0500 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-09-22 21:14:10 +1000 |
commit | b3bbac02d5e320c350c460680fc7644735d01e0b (patch) | |
tree | d87dc26467b013e75a3f01661f9dba268f3e5538 /livetree.c | |
parent | fe50bd1ecc1da273a7627a76dcd38da9d77e496f (diff) | |
download | device-tree-compiler-b3bbac02d5e320c350c460680fc7644735d01e0b.tar.gz |
checks: add phandle with arg property checks
Many common bindings follow the same pattern of client properties
containing a phandle and N arg cells where N is defined in the provider
with a '#<specifier>-cells' property such as:
intc0: interrupt-controller@0 {
#interrupt-cells = <3>;
};
intc1: interrupt-controller@1 {
#interrupt-cells = <2>;
};
node {
interrupts-extended = <&intc0 1 2 3>, <&intc1 4 5>;
};
Add checks for properties following this pattern.
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'livetree.c')
-rw-r--r-- | livetree.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -396,6 +396,12 @@ cell_t propval_cell(struct property *prop) return fdt32_to_cpu(*((fdt32_t *)prop->val.val)); } +cell_t propval_cell_n(struct property *prop, int n) +{ + assert(prop->val.len / sizeof(cell_t) >= n); + return fdt32_to_cpu(*((fdt32_t *)prop->val.val + n)); +} + struct property *get_property_by_label(struct node *tree, const char *label, struct node **node) { |