All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Peng Fan <peng.fan@nxp.com>
Cc: Chen Ni <nichen@iscas.ac.cn>,
	"andersson@kernel.org" <andersson@kernel.org>,
	Frank Li <frank.li@nxp.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"linux-remoteproc@vger.kernel.org"
	<linux-remoteproc@vger.kernel.org>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] remoteproc: imx_rproc: Check return value of regmap_attach_dev() in imx_rproc_mmio_detect_mode()
Date: Fri, 6 Feb 2026 09:10:11 -0700	[thread overview]
Message-ID: <aYYSY3Rn3702zk3S@p14s> (raw)
In-Reply-To: <PAXPR04MB8459ABF483274720F6BB23188866A@PAXPR04MB8459.eurprd04.prod.outlook.com>

On Fri, Feb 06, 2026 at 03:34:41AM +0000, Peng Fan wrote:
> > Subject: [PATCH] remoteproc: imx_rproc: Check return value of
> > regmap_attach_dev() in imx_rproc_mmio_detect_mode()
> > 
> > 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.
> > 
> > Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
> > ---
> >  drivers/remoteproc/imx_rproc.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/remoteproc/imx_rproc.c
> > b/drivers/remoteproc/imx_rproc.c index f5f916d67905..0e23f519c247
> > 100644
> > --- a/drivers/remoteproc/imx_rproc.c
> > +++ b/drivers/remoteproc/imx_rproc.c
> > @@ -1007,7 +1007,9 @@ static int
> > imx_rproc_mmio_detect_mode(struct rproc *rproc)
> >  	}
> > 
> >  	priv->regmap = regmap;
> > -	regmap_attach_dev(dev, regmap, &config);
> > +	ret = regmap_attach_dev(dev, regmap, &config);
> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "regmap attach
> > failed\n");
> 
> 
> In the main probe, there is already dev_err_probe for
> detect_mode. So I would use below style as other error
> return in imx_rproc_mmio_detect_mode():
> dev_err("regmap attach failed\n");
> return ret;
> 
> Let's wait Mathieu's view.
>

I agreew with Peng's assessment.
 
> Regards
> Peng.
> 
> > 
> >  	if (priv->gpr) {
> >  		ret = regmap_read(priv->gpr, dcfg->gpr_reg, &val);
> > --
> > 2.25.1
> > 
> 

      parent reply	other threads:[~2026-02-06 16:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05  5:09 [PATCH] remoteproc: imx_rproc: Check return value of regmap_attach_dev() in imx_rproc_mmio_detect_mode() Chen Ni
2026-02-06  3:34 ` Peng Fan
2026-02-06  3:41   ` Peng Fan
2026-02-06 16:10   ` Mathieu Poirier [this message]

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=aYYSY3Rn3702zk3S@p14s \
    --to=mathieu.poirier@linaro.org \
    --cc=andersson@kernel.org \
    --cc=festevam@gmail.com \
    --cc=frank.li@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=nichen@iscas.ac.cn \
    --cc=peng.fan@nxp.com \
    --cc=s.hauer@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.