[PATCH v2 12/12] ASoC: sprd: Use devm_of_reserved_mem_device_init()
From: Mukesh Ojha
Date: Wed Sep 02 2026 - 16:39:53 EST
Use the devres-managed devm_of_reserved_mem_device_init() to ensure
the reserved memory region is released on device removal, fixing a
missing cleanup — the driver has no remove function. Also drop the
now-unused local variable np.
Signed-off-by: Mukesh Ojha <mukesh.ojha@xxxxxxxxxxxxxxxx>
---
sound/soc/sprd/sprd-pcm-dma.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/sprd/sprd-pcm-dma.c b/sound/soc/sprd/sprd-pcm-dma.c
index f509a4601de2..2d5ffbe17e81 100644
--- a/sound/soc/sprd/sprd-pcm-dma.c
+++ b/sound/soc/sprd/sprd-pcm-dma.c
@@ -459,10 +459,9 @@ static const struct snd_soc_component_driver sprd_soc_component = {
static int sprd_soc_platform_probe(struct platform_device *pdev)
{
- struct device_node *np = pdev->dev.of_node;
int ret;
- ret = of_reserved_mem_device_init_by_idx(&pdev->dev, np, 0);
+ ret = devm_of_reserved_mem_device_init(&pdev->dev);
if (ret)
dev_warn(&pdev->dev,
"no reserved DMA memory for audio platform device\n");
--
2.55.0