From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: mdshahid03@gmail.com, "Andy Shevchenko" <andy@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>, "Ray Jui" <rjui@broadcom.com>,
"Scott Branden" <sbranden@broadcom.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
"Markus Elfring" <Markus.Elfring@web.de>,
"Joshua Crofts" <joshua.crofts1@gmail.com>,
linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 3/3] iio: adc: bcm_iproc_adc: Convert probe error handling to dev_err_probe()
Date: Sun, 16 Aug 2026 02:15:39 +0100 [thread overview]
Message-ID: <20260816021539.5f95f403@jic23-huawei> (raw)
In-Reply-To: <anmMmrbhUvtmm5xs@ashevche-desk.local>
On Mon, 10 Aug 2026 11:32:26 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Thu, Aug 06, 2026 at 08:09:02AM +0530, mdshahid03@gmail.com wrote:
>
> > Replace open-coded dev_err() followed by return with dev_err_probe()
> > for probe failures that immediately return.
> >
> > Leave error paths that jump to cleanup labels unchanged to reduce code
> > churn. These paths will be converted separately together with the
> > planned devm-managed cleanup using devm_add_action_or_reset().
>
> ...
>
> > adc_priv->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
> > "adc-syscon");
>
> Size note: the above can be also amended (since you have a 'dev') to
>
> adc_priv->regmap = syscon_regmap_lookup_by_phandle(dev->of_node,
> "adc-syscon");
>
> But we can go even further (in a separate patch) and move it to
>
> adc_priv->regmap = syscon_regmap_lookup_by_phandle(dev_of_node(dev),
> "adc-syscon");
>
> ...
>
> > adc_priv->adc_clk = devm_clk_get(dev, "tsc_clk");
> > - if (IS_ERR(adc_priv->adc_clk)) {
> > - dev_err(&pdev->dev,
> > - "failed getting clock tsc_clk\n");
> > - ret = PTR_ERR(adc_priv->adc_clk);
> > - return ret;
> > - }
> > + if (IS_ERR(adc_priv->adc_clk))
> > + return dev_err_probe(dev, PTR_ERR(adc_priv->adc_clk),
> > + "failed getting clock tsc_clk\n");
>
> > ret = clk_prepare_enable(adc_priv->adc_clk);
> > - if (ret) {
> > - dev_err(&pdev->dev,
> > - "clk_prepare_enable failed %d\n", ret);
> > - return ret;
> > - }
> > + if (ret)
> > + return dev_err_probe(dev, ret, "failed to enable clock\n");
>
> This will be less churn if the previous (new) patch will convert this to use
> devn_clk_get_enabled(). But if Jonathan is okay with this patch as is, you
> can take my
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Too much in my backlog for me to keep track so I'll merge what we have
here and a follow up bit of devm_ work can be a separate series (this
time - look for similar opportunities if you do similar work
in future!)
Series applied to the testing branch of iio.git.
Jonathan
>
prev parent reply other threads:[~2026-08-16 1:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 2:38 [PATCH v6 0/3] iio: adc: bcm_iproc_adc: Simplify probe error handling mdshahid03
2026-08-06 2:39 ` [PATCH v6 1/3] iio: adc: bcm_iproc_adc: Remove redundant probe error messages mdshahid03
2026-08-10 8:25 ` Andy Shevchenko
2026-08-06 2:39 ` [PATCH v6 2/3] iio: adc: bcm_iproc_adc: Introduce local device pointer mdshahid03
2026-08-10 8:26 ` Andy Shevchenko
2026-08-06 2:39 ` [PATCH v6 3/3] iio: adc: bcm_iproc_adc: Convert probe error handling to dev_err_probe() mdshahid03
2026-08-10 8:32 ` Andy Shevchenko
2026-08-16 1:15 ` Jonathan Cameron [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=20260816021539.5f95f403@jic23-huawei \
--to=jic23@kernel.org \
--cc=Markus.Elfring@web.de \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=dlechner@baylibre.com \
--cc=joshua.crofts1@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdshahid03@gmail.com \
--cc=nuno.sa@analog.com \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.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 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.