* [PATCH 1/2] ASoC: SOF: imx: Fix an IS_ERR() vs NULL bug in imx_parse_ioremap_memory()
[not found] <cover.1739435600.git.dan.carpenter@linaro.org>
@ 2025-02-17 7:32 ` Dan Carpenter
2025-02-18 21:30 ` Mark Brown
2025-02-17 7:32 ` [PATCH 2/2] ASoC: SOF: imx: Fix error code in probe() Dan Carpenter
1 sibling, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2025-02-17 7:32 UTC (permalink / raw)
To: Laurentiu Mihalcea
Cc: Liam Girdwood, Peter Ujfalusi, Bard Liao, Ranjani Sridharan,
Daniel Baluta, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Frank Li,
sound-open-firmware, linux-sound, imx, linux-arm-kernel,
linux-kernel
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")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
sound/soc/sof/imx/imx-common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sof/imx/imx-common.c b/sound/soc/sof/imx/imx-common.c
index 82057af1436c..5a385d140bc7 100644
--- a/sound/soc/sof/imx/imx-common.c
+++ b/sound/soc/sof/imx/imx-common.c
@@ -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);
}
--
2.47.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 2/2] ASoC: SOF: imx: Fix error code in probe()
[not found] <cover.1739435600.git.dan.carpenter@linaro.org>
2025-02-17 7:32 ` [PATCH 1/2] ASoC: SOF: imx: Fix an IS_ERR() vs NULL bug in imx_parse_ioremap_memory() Dan Carpenter
@ 2025-02-17 7:32 ` Dan Carpenter
1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-02-17 7:32 UTC (permalink / raw)
To: Laurentiu Mihalcea
Cc: Liam Girdwood, Peter Ujfalusi, Bard Liao, Ranjani Sridharan,
Daniel Baluta, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Frank Li,
sound-open-firmware, linux-sound, imx, linux-arm-kernel,
linux-kernel
This accidentally returns "common->clk_num" instead of "ret".
Fixes: 651e0ed391b1 ("ASoC: SOF: imx: introduce more common structures and functions")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
sound/soc/sof/imx/imx-common.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/sof/imx/imx-common.c b/sound/soc/sof/imx/imx-common.c
index 5a385d140bc7..b8df8bbacad5 100644
--- a/sound/soc/sof/imx/imx-common.c
+++ b/sound/soc/sof/imx/imx-common.c
@@ -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);
--
2.47.2
^ permalink raw reply related [flat|nested] 3+ messages in thread