From: Daniel Baluta <daniel.baluta@nxp.com>
To: broonie@kernel.org
Cc: linux-sound@vger.kernel.org, imx@lists.linux.dev,
linux-kernel@vger.kernel.org, Frank.Li@nxp.com, robh@kernel.org,
laurentiu.mihalcea@nxp.com, dan.carpenter@linaro.org,
waqar.hameed@axis.com, festevam@gmail.com, kernel@pengutronix.de,
lgirdwood@gmail.com, peter.ujfalusi@linux.intel.com,
yung-chuan.liao@linux.intel.com,
ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com,
Daniel Baluta <daniel.baluta@nxp.com>
Subject: [PATCH v2] ASoC: SOF: imx: Fix devm_ioremap_resource check
Date: Tue, 2 Sep 2025 13:21:00 +0300 [thread overview]
Message-ID: <20250902102101.378809-1-daniel.baluta@nxp.com> (raw)
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
next reply other threads:[~2025-09-02 10:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 10:21 Daniel Baluta [this message]
2025-09-02 13:37 ` [PATCH v2] ASoC: SOF: imx: Fix devm_ioremap_resource check Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250902102101.378809-1-daniel.baluta@nxp.com \
--to=daniel.baluta@nxp.com \
--cc=Frank.Li@nxp.com \
--cc=broonie@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kai.vehmanen@linux.intel.com \
--cc=kernel@pengutronix.de \
--cc=laurentiu.mihalcea@nxp.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=peter.ujfalusi@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=robh@kernel.org \
--cc=waqar.hameed@axis.com \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox