diff options
author | Rob Herring <robh@kernel.org> | 2021-10-11 14:12:44 -0500 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2021-10-14 14:46:17 +1100 |
commit | 8fd24744e3618be99a939009349418fcbfa362b3 (patch) | |
tree | 31a9826443918c17d933aa9984037daad9647a79 /checks.c | |
parent | d8d1a9a77863a8c7031ae82a1d461aa78eb72a7b (diff) | |
download | dtc-8fd24744e3618be99a939009349418fcbfa362b3.zip dtc-8fd24744e3618be99a939009349418fcbfa362b3.tar.gz dtc-8fd24744e3618be99a939009349418fcbfa362b3.tar.bz2 |
checks: Ensure '#interrupt-cells' only exists in interrupt providers
The interrupt provider check currently checks if an interrupt provider
has #interrupt-cells, but not whether #interrupt-cells is present
outside of interrupt-providers. Rework the check to cover the latter
case.
Cc: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20211011191245.1009682-4-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'checks.c')
-rw-r--r-- | checks.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1573,14 +1573,20 @@ static void check_interrupt_provider(struct check *c, struct node *node) { struct property *prop; + bool irq_provider = node_is_interrupt_provider(node); - if (!node_is_interrupt_provider(node)) + prop = get_property(node, "#interrupt-cells"); + if (irq_provider && !prop) { + FAIL(c, dti, node, + "Missing '#interrupt-cells' in interrupt provider"); return; + } - prop = get_property(node, "#interrupt-cells"); - if (!prop) + if (!irq_provider && prop) { FAIL(c, dti, node, - "Missing #interrupt-cells in interrupt provider"); + "'#interrupt-cells' found, but node is not an interrupt provider"); + return; + } } WARNING(interrupt_provider, check_interrupt_provider, NULL, &interrupts_extended_is_cell); |