Skip to contentSkip to conversation

ASoC: SOF: imx: Fix an IS_ERR() vs NULL bug in imx_parse_ioremap_memory()

PATCH In review Dan Carpenter 2 participants 3 messages Feb 17, 2025 – Feb 18, 2025 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#1 lore raw

PATCH 1/2 ASoC: SOF: imx: Fix an IS_ERR() vs NULL bug in imx_parse_ioremap_memory()

In reply to a message not in the archive

The devm_ioremap() function doesn't return error pointers, it returns NULL on error. Update the checking to match.

Fixes 651e0ed391b1 ("ASoC: SOF: imx: introduce more common structures and functions")
---
 sound/soc/sof/imx/imx-common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/sof/imx/imx-common.c +2 -2
index 82057af1436c..5a385d140bc7 100644
@@ -338,9 +338,9 @@ static int imx_parse_ioremap_memory(struct snd_sof_dev *sdev)
 		}
 
 		sdev->bar[blk_type] = devm_ioremap(sdev->dev, base, size);
-		if (IS_ERR(sdev->bar[blk_type]))
+		if (!sdev->bar[blk_type])
 			return dev_err_probe(sdev->dev,
-					     PTR_ERR(sdev->bar[blk_type]),
+					     -ENOMEM,
 					     "failed to ioremap %s region\n",
 					     chip_info->memory[i].name);
 	}
Signature · 1 line
2.47.2
#3 lore raw

PATCH 2/2 ASoC: SOF: imx: Fix error code in probe()

In reply to a message not in the archive

This accidentally returns "common->clk_num" instead of "ret".

Fixes 651e0ed391b1 ("ASoC: SOF: imx: introduce more common structures and functions")
---
 sound/soc/sof/imx/imx-common.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/sof/imx/imx-common.c +1 -2
index 5a385d140bc7..b8df8bbacad5 100644
@@ -424,8 +424,7 @@ static int imx_probe(struct snd_sof_dev *sdev)
 
 	ret = devm_clk_bulk_get_all(sdev->dev, &common->clks);
 	if (ret < 0)
-		return dev_err_probe(sdev->dev, common->clk_num,
-				     "failed to fetch clocks\n");
+		return dev_err_probe(sdev->dev, ret, "failed to fetch clocks\n");
 	common->clk_num = ret;
 
 	ret = clk_bulk_prepare_enable(common->clk_num, common->clks);
Signature · 1 line
2.47.2
maintainer
#2 lore raw
In reply to Dan Carpenter
Quoted 4 lines · Dan Carpenter

The devm_ioremap() function doesn't return error pointers, it returns NULL on error. Update the checking to match.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: SOF: imx: Fix an IS_ERR() vs NULL bug in imx_parse_ioremap_memory()

      commit: b20be2c77ce5341ded1a2d8aec119f6dca8ef1ad
[2/2] ASoC: SOF: imx: Fix error code in probe()
      commit: a78f244a9150da0878a37a1b59fb0608b1ccfb9d

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a 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.

Thanks,
Mark