linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: ti: knav: Drop unnecessary check for property presence
@ 2024-07-31 20:13 Rob Herring (Arm)
  2024-08-06 21:33 ` Nishanth Menon
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring (Arm) @ 2024-07-31 20:13 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar; +Cc: linux-kernel, linux-arm-kernel

of_property_read_u32() returns -EINVAL if a property is not present, so
the preceeding check for presence with of_get_property() can be
dropped.

This is part of a larger effort to remove callers of of_get_property()
and similar functions. of_get_property() leaks 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>
---
 drivers/soc/ti/knav_qmss_queue.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index f2055a76f84c..a15eaa1900ab 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -1104,11 +1104,6 @@ static int knav_queue_setup_regions(struct knav_device *kdev,
 			continue;
 		}
 
-		if (!of_get_property(child, "link-index", NULL)) {
-			dev_err(dev, "No link info for %s\n", region->name);
-			devm_kfree(dev, region);
-			continue;
-		}
 		ret = of_property_read_u32(child, "link-index",
 					   &region->link_index);
 		if (ret) {
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-06 21:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31 20:13 [PATCH] soc: ti: knav: Drop unnecessary check for property presence Rob Herring (Arm)
2024-08-06 21:33 ` Nishanth Menon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).