Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc/sram: 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 to of_property_read_bool().

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230310144713.1543544-1-robh@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Rob Herring and committed by
Greg Kroah-Hartman
d7d744ab c2c99326

+3 -8
+3 -8
drivers/misc/sram.c
··· 218 218 block->res = child_res; 219 219 list_add_tail(&block->list, &reserve_list); 220 220 221 - if (of_find_property(child, "export", NULL)) 222 - block->export = true; 223 - 224 - if (of_find_property(child, "pool", NULL)) 225 - block->pool = true; 226 - 227 - if (of_find_property(child, "protect-exec", NULL)) 228 - block->protect_exec = true; 221 + block->export = of_property_read_bool(child, "export"); 222 + block->pool = of_property_read_bool(child, "pool"); 223 + block->protect_exec = of_property_read_bool(child, "protect-exec"); 229 224 230 225 if ((block->export || block->pool || block->protect_exec) && 231 226 block->size) {