linux-sound.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: SOF: imx: Fix devm_ioremap_resource check
@ 2025-09-02 10:21 Daniel Baluta
  2025-09-02 13:37 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Baluta @ 2025-09-02 10:21 UTC (permalink / raw)
  To: broonie
  Cc: linux-sound, imx, linux-kernel, Frank.Li, robh,
	laurentiu.mihalcea, dan.carpenter, waqar.hameed, festevam, kernel,
	lgirdwood, peter.ujfalusi, yung-chuan.liao, ranjani.sridharan,
	kai.vehmanen, Daniel Baluta

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: bc163baef570 ("ASoC: Use of_reserved_mem_region_to_resource() for "memory-region"")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
Changes since v1:
 - pass the error code to dev_err_probe

 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 40debc541bf9..e787d3932fbb 100644
--- a/sound/soc/sof/imx/imx-common.c
+++ b/sound/soc/sof/imx/imx-common.c
@@ -316,9 +316,9 @@ static int imx_parse_ioremap_memory(struct snd_sof_dev *sdev)
 		}
 
 		sdev->bar[blk_type] = devm_ioremap_resource(sdev->dev, res);
-		if (!sdev->bar[blk_type])
+		if (IS_ERR(sdev->bar[blk_type]))
 			return dev_err_probe(sdev->dev,
-					     -ENOMEM,
+					     PTR_ERR(sdev->bar[blk_type]),
 					     "failed to ioremap %s region\n",
 					     chip_info->memory[i].name);
 	}
-- 
2.45.2


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

* Re: [PATCH v2] ASoC: SOF: imx: Fix devm_ioremap_resource check
  2025-09-02 10:21 [PATCH v2] ASoC: SOF: imx: Fix devm_ioremap_resource check Daniel Baluta
@ 2025-09-02 13:37 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-09-02 13:37 UTC (permalink / raw)
  To: Daniel Baluta
  Cc: linux-sound, imx, linux-kernel, Frank.Li, robh,
	laurentiu.mihalcea, dan.carpenter, waqar.hameed, festevam, kernel,
	lgirdwood, peter.ujfalusi, yung-chuan.liao, ranjani.sridharan,
	kai.vehmanen

On Tue, 02 Sep 2025 13:21:00 +0300, Daniel Baluta wrote:
> 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.
> 
> [...]

Applied to

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

Thanks!

[1/1] ASoC: SOF: imx: Fix devm_ioremap_resource check
      commit: 0c28431f6fe13f3a3be0978f79c1a7ae8a93d028

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] 2+ messages in thread

end of thread, other threads:[~2025-09-02 13:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02 10:21 [PATCH v2] ASoC: SOF: imx: Fix devm_ioremap_resource check Daniel Baluta
2025-09-02 13:37 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).