summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 08:46:57 -0600
committerMichael Ellerman <mpe@ellerman.id.au>2023-03-30 23:36:35 +1100
commit4d57e3515e3838b12eccbeb5e0e52f053e3f638a (patch)
tree6b3a69db4051b3f6a547e34a39df8105ac149072 /arch/powerpc/kernel
parent857d423c74228cfa064f79ff3a16b163fdb8d542 (diff)
downloadlinux-stable-4d57e3515e3838b12eccbeb5e0e52f053e3f638a.tar.gz
linux-stable-4d57e3515e3838b12eccbeb5e0e52f053e3f638a.tar.bz2
linux-stable-4d57e3515e3838b12eccbeb5e0e52f053e3f638a.zip
powerpc: Use of_property_read_bool() for boolean properties
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. Convert reading boolean properties to of_property_read_bool(). Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230310144659.1541127-1-robh@kernel.org
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/btext.c2
-rw-r--r--arch/powerpc/kernel/legacy_serial.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
index 2769889219bf..19e46fd623b0 100644
--- a/arch/powerpc/kernel/btext.c
+++ b/arch/powerpc/kernel/btext.c
@@ -235,7 +235,7 @@ int __init btext_find_display(int allow_nonstdout)
return rc;
for_each_node_by_type(np, "display") {
- if (of_get_property(np, "linux,opened", NULL)) {
+ if (of_property_read_bool(np, "linux,opened")) {
printk("trying %pOF ...\n", np);
rc = btext_initialize(np);
printk("result: %d\n", rc);
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 1a3b7f3513b4..c9ad12461d44 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -179,7 +179,7 @@ static int __init add_legacy_soc_port(struct device_node *np,
return -1;
/* if rtas uses this device, don't try to use it as well */
- if (of_get_property(np, "used-by-rtas", NULL) != NULL)
+ if (of_property_read_bool(np, "used-by-rtas"))
return -1;
/* Get the address */