diff options
author | Rob Herring (Arm) <robh@kernel.org> | 2024-07-31 21:12:48 +0200 |
---|---|---|
committer | Rob Herring (Arm) <robh@kernel.org> | 2024-08-06 21:22:13 +0200 |
commit | 1c668ea65506e67ce2eae07b69bb09fcdd86e309 (patch) | |
tree | 4b2d81d6fcdcb634c44e7bd388b5122a219da814 /drivers/of/unittest.c | |
parent | dt-bindings: hwmon: Document TI TPS546D24 (diff) | |
download | linux-1c668ea65506e67ce2eae07b69bb09fcdd86e309.tar.xz linux-1c668ea65506e67ce2eae07b69bb09fcdd86e309.zip |
of: unittest: Use of_property_present()
Use of_property_present() to test for property presence rather than
of_find_property(). This is part of a larger effort to remove callers
of of_find_property() and similar functions. of_find_property() leaks
the DT struct property and data pointers which is a problem for
dynamically allocated nodes which may be freed.
Link: https://lore.kernel.org/r/20240731191312.1710417-10-robh@kernel.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Diffstat (limited to 'drivers/of/unittest.c')
-rw-r--r-- | drivers/of/unittest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index c830f346df45..b60b4b7d7172 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -900,8 +900,8 @@ static void __init of_unittest_changeset(void) unittest(!of_find_node_by_path("/testcase-data/changeset/n2/n21"), "'%pOF' still present after revert\n", n21); - ppremove = of_find_property(parent, "prop-remove", NULL); - unittest(ppremove, "failed to find removed prop after revert\n"); + unittest(of_property_present(parent, "prop-remove"), + "failed to find removed prop after revert\n"); ret = of_property_read_string(parent, "prop-update", &propstr); unittest(!ret, "failed to find updated prop after revert\n"); |