summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 08:47:12 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-17 15:23:25 +0100
commitd7d744abc08f008f105dc7fc59805de6beeb8ec8 (patch)
tree8a132da4d1302eac11c43abc74c8bddec955409a /drivers/misc
parentc2c99326cc0176cbc3e7c11e97db11ca56077d10 (diff)
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>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/sram.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index dec92580a42c..99413310956b 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -218,14 +218,9 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res)
block->res = child_res;
list_add_tail(&block->list, &reserve_list);
- if (of_find_property(child, "export", NULL))
- block->export = true;
-
- if (of_find_property(child, "pool", NULL))
- block->pool = true;
-
- if (of_find_property(child, "protect-exec", NULL))
- block->protect_exec = true;
+ block->export = of_property_read_bool(child, "export");
+ block->pool = of_property_read_bool(child, "pool");
+ block->protect_exec = of_property_read_bool(child, "protect-exec");
if ((block->export || block->pool || block->protect_exec) &&
block->size) {