diff options
author | Rob Herring <robh@kernel.org> | 2023-03-10 17:46:56 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-03-30 15:36:35 +0300 |
commit | 857d423c74228cfa064f79ff3a16b163fdb8d542 (patch) | |
tree | 42cebf275a0709c63da9bda60d200c95ddaa4f51 /arch/powerpc/platforms/44x | |
parent | af8bc68263b2184e63ee67ca70cecff4636f7901 (diff) | |
download | linux-857d423c74228cfa064f79ff3a16b163fdb8d542.tar.xz |
powerpc: Use of_property_present() for testing DT property presence
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties. As
part of this, convert of_get_property/of_find_property calls to the
recently added of_property_present() helper when we just want to test
for presence of a property and nothing more.
Signed-off-by: Rob Herring <robh@kernel.org>
[mpe: Drop change in ppc4xx_probe_pci_bridge(), formatting]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230310144657.1541039-1-robh@kernel.org
Diffstat (limited to 'arch/powerpc/platforms/44x')
-rw-r--r-- | arch/powerpc/platforms/44x/iss4xx.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/44x/ppc476.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/44x/iss4xx.c b/arch/powerpc/platforms/44x/iss4xx.c index 981972e8347f..ef883d97fe15 100644 --- a/arch/powerpc/platforms/44x/iss4xx.c +++ b/arch/powerpc/platforms/44x/iss4xx.c @@ -52,7 +52,7 @@ static void __init iss4xx_init_irq(void) /* Find top level interrupt controller */ for_each_node_with_property(np, "interrupt-controller") { - if (of_get_property(np, "interrupts", NULL) == NULL) + if (!of_property_present(np, "interrupts")) break; } if (np == NULL) diff --git a/arch/powerpc/platforms/44x/ppc476.c b/arch/powerpc/platforms/44x/ppc476.c index 3135e654a743..fbc6edad481f 100644 --- a/arch/powerpc/platforms/44x/ppc476.c +++ b/arch/powerpc/platforms/44x/ppc476.c @@ -123,7 +123,7 @@ static void __init ppc47x_init_irq(void) /* Find top level interrupt controller */ for_each_node_with_property(np, "interrupt-controller") { - if (of_get_property(np, "interrupts", NULL) == NULL) + if (!of_property_present(np, "interrupts")) break; } if (np == NULL) |