Skip to content

Commit 5bfc585

Browse files
Chen Nigregkh
authored andcommitted
remoteproc: imx_rproc: Check return value of regmap_attach_dev() in imx_rproc_mmio_detect_mode()
[ Upstream commit a48c667 ] Add error checking for regmap_attach_dev() call in imx_rproc_mmio_detect_mode() function to ensure proper error propagation. Return the value of regmap_attach_dev() if it fails to prevent proceeding with an incomplete regmap setup. Suggested-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Fixes: e14168b ("remoteproc: imx_rproc: Simplify IMX_RPROC_MMIO switch case") Link: https://lore.kernel.org/r/20260209051407.1467660-1-nichen@iscas.ac.cn Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 28122fc commit 5bfc585

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/remoteproc/imx_rproc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,11 @@ static int imx_rproc_mmio_detect_mode(struct rproc *rproc)
899899
}
900900

901901
priv->regmap = regmap;
902-
regmap_attach_dev(dev, regmap, &config);
902+
ret = regmap_attach_dev(dev, regmap, &config);
903+
if (ret) {
904+
dev_err(dev, "regmap attach failed\n");
905+
return ret;
906+
}
903907

904908
if (priv->gpr) {
905909
ret = regmap_read(priv->gpr, dcfg->gpr_reg, &val);

0 commit comments

Comments
 (0)