Skip to content

Commit 0c28431

Browse files
dbalutabroonie
authored andcommitted
ASoC: SOF: imx: Fix devm_ioremap_resource check
devm_ioremap_resource does not return NULL on error but an error pointer so we need to use IS_ERR to check the return code. While at it also pass the error code to dev_err_probe to improve logging. Fixes: bc163ba ("ASoC: Use of_reserved_mem_region_to_resource() for "memory-region"") Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://patch.msgid.link/20250902102101.378809-1-daniel.baluta@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 28edfaa commit 0c28431

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/soc/sof/imx/imx-common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ static int imx_parse_ioremap_memory(struct snd_sof_dev *sdev)
316316
}
317317

318318
sdev->bar[blk_type] = devm_ioremap_resource(sdev->dev, res);
319-
if (!sdev->bar[blk_type])
319+
if (IS_ERR(sdev->bar[blk_type]))
320320
return dev_err_probe(sdev->dev,
321-
-ENOMEM,
321+
PTR_ERR(sdev->bar[blk_type]),
322322
"failed to ioremap %s region\n",
323323
chip_info->memory[i].name);
324324
}

0 commit comments

Comments
 (0)