diff options
author | Rob Herring (Arm) <robh@kernel.org> | 2024-07-31 22:13:04 +0300 |
---|---|---|
committer | Ira Weiny <ira.weiny@intel.com> | 2024-08-22 00:06:43 +0300 |
commit | 795191854a8ff04a195c1cab856a61bd5677dda9 (patch) | |
tree | b081531c2581579ad55d20d3d83525711152d07c /drivers/nvdimm | |
parent | 47ac09b91befbb6a235ab620c32af719f8208399 (diff) | |
download | linux-795191854a8ff04a195c1cab856a61bd5677dda9.tar.xz |
nvdimm: Use of_property_present() and of_property_read_bool()
Use of_property_present() and of_property_read_bool() to test
property presence and read boolean properties rather than
of_(find|get)_property(). This is part of a larger effort to remove
callers of of_find_property() and similar functions.
of_(find|get)_property() leak the DT struct property and data pointers
which is a problem for dynamically allocated nodes which may be freed.
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20240731191312.1710417-26-robh@kernel.org
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r-- | drivers/nvdimm/of_pmem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvdimm/of_pmem.c b/drivers/nvdimm/of_pmem.c index 403384f25ce3..b4a1cf70e8b7 100644 --- a/drivers/nvdimm/of_pmem.c +++ b/drivers/nvdimm/of_pmem.c @@ -47,7 +47,7 @@ static int of_pmem_region_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, priv); - is_volatile = !!of_find_property(np, "volatile", NULL); + is_volatile = of_property_read_bool(np, "volatile"); dev_dbg(&pdev->dev, "Registering %s regions from %pOF\n", is_volatile ? "volatile" : "non-volatile", np); |