diff mbox series

soc: ti: knav: Drop unnecessary check for property presence

Message ID 20240731201407.1838385-2-robh@kernel.org (mailing list archive)
State New, archived
Headers show
Series soc: ti: knav: Drop unnecessary check for property presence | expand

Commit Message

Rob Herring July 31, 2024, 8:13 p.m. UTC
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(-)

Comments

Nishanth Menon Aug. 6, 2024, 9:33 p.m. UTC | #1
Hi Rob Herring (Arm),

On Wed, 31 Jul 2024 14:13:57 -0600, Rob Herring (Arm) wrote:
> of_property_read_u32() returns -EINVAL if a property is not present, so
> the preceeding check for presence with of_get_property() can be

I fixed up the typo s/preceeding/preceding locally

> 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.
> 
> [...]

I have applied the following to branch ti-drivers-soc-next on [1].
Thank you!

[1/1] soc: ti: knav: Drop unnecessary check for property presence
      commit: 8737e167dc55cc00c5818b408f47ba03b6ddb25b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent up the chain during
the next merge window (or sooner if it is a relevant bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
diff mbox series

Patch

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) {