Commit a1c8929b authored by Rob Herring (Arm)'s avatar Rob Herring (Arm) Committed by Mark Brown

ASoC: Use of_property_present()

Use of_property_present() to test for property presence rather than
of_get_property(). This is part of a larger effort to remove callers
of of_get_property() and similar functions. of_get_property() leaks
the DT property data pointer which is a problem for dynamically
allocated nodes which may be freed.
Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240731191312.1710417-19-robh@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d5742b5d
...@@ -184,7 +184,7 @@ static int psc_i2s_of_probe(struct platform_device *op) ...@@ -184,7 +184,7 @@ static int psc_i2s_of_probe(struct platform_device *op)
/* Check for the codec handle. If it is not present then we /* Check for the codec handle. If it is not present then we
* are done */ * are done */
if (!of_get_property(op->dev.of_node, "codec-handle", NULL)) if (!of_property_present(op->dev.of_node, "codec-handle"))
return 0; return 0;
/* Due to errata in the dma mode; need to line up enabling /* Due to errata in the dma mode; need to line up enabling
......
...@@ -213,7 +213,7 @@ int tegra_pcm_construct(struct snd_soc_component *component, ...@@ -213,7 +213,7 @@ int tegra_pcm_construct(struct snd_soc_component *component,
* Fallback for backwards-compatibility with older device trees that * Fallback for backwards-compatibility with older device trees that
* have the iommus property in the virtual, top-level "sound" node. * have the iommus property in the virtual, top-level "sound" node.
*/ */
if (!of_get_property(dev->of_node, "iommus", NULL)) if (!of_property_present(dev->of_node, "iommus"))
dev = rtd->card->snd_card->dev; dev = rtd->card->snd_card->dev;
return tegra_pcm_dma_allocate(dev, rtd, tegra_pcm_hardware.buffer_bytes_max); return tegra_pcm_dma_allocate(dev, rtd, tegra_pcm_hardware.buffer_bytes_max);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment