Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [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

* Re: [PATCH 1/2] ASoC: SOF: imx: Fix an IS_ERR() vs NULL bug in imx_parse_ioremap_memory()
  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-18 21:30   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-02-18 21:30 UTC (permalink / raw)
  To: Laurentiu Mihalcea, Dan Carpenter
  Cc: Liam Girdwood, Peter Ujfalusi, Bard Liao, Ranjani Sridharan,
	Daniel Baluta, Kai Vehmanen, Pierre-Louis Bossart,
	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

On Mon, 17 Feb 2025 10:32:44 +0300, Dan Carpenter wrote:
> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-18 21:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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-18 21:30   ` Mark Brown
2025-02-17  7:32 ` [PATCH 2/2] ASoC: SOF: imx: Fix error code in probe() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox