Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Michal Piekos" <michal.piekos@mmpsystems.pl>
Cc: robh@kernel.org, linux-sunxi@lists.linux.dev,
	devicetree@vger.kernel.org, conor+dt@kernel.org,
	krzk+dt@kernel.org
Subject: Re: [PATCH v2 2/3] iio: adc: sun20i-gpadc: add A523 gpadc support
Date: Thu, 14 May 2026 02:29:37 +0000	[thread overview]
Message-ID: <20260514022938.5889BC19425@smtp.kernel.org> (raw)
In-Reply-To: <20260513-sunxi-a523-gpadc-v2-2-d5efde151dac@mmpsystems.pl>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] If `devm_clk_bulk_get_all_enabled()` returns 0 (meaning no clocks are defined in the device tree), the driver aborts the probe early but incorrectly returns 0 (success).
--

commit 6e1c58e982371b9be677bdb51d74117b3577cd6f
Author: Michal Piekos <michal.piekos@mmpsystems.pl>

iio: adc: sun20i-gpadc: add A523 gpadc support

This commit adds support for the A523 gpadc by switching to the bulk clock
API to handle both bus and module clocks.

> diff --git a/drivers/iio/adc/sun20i-gpadc-iio.c b/drivers/iio/adc/sun20i-gpadc-iio.c
> index 861c14da75add..3f1f07b3a3856 100644
> --- a/drivers/iio/adc/sun20i-gpadc-iio.c
> +++ b/drivers/iio/adc/sun20i-gpadc-iio.c
[ ... ]
> @@ -205,9 +205,11 @@ static int sun20i_gpadc_probe(struct platform_device *pdev)
>  	if (IS_ERR(info->regs))
>  		return PTR_ERR(info->regs);
>  
> -	clk = devm_clk_get_enabled(dev, NULL);
> -	if (IS_ERR(clk))
> -		return dev_err_probe(dev, PTR_ERR(clk), "failed to enable bus clock\n");
> +	ret = devm_clk_bulk_get_all_enabled(dev, &clks);
> +	if (ret <= 0)
> +		return dev_err_probe(
> +			dev, ret,
> +			"failed to enable clocks or no clocks defined\n");

When devm_clk_bulk_get_all_enabled() returns 0 (meaning no clocks are defined),
will this code return 0 from the probe function?

Since dev_err_probe() returns the error code passed to it, returning 0 here
would cause sun20i_gpadc_probe() to succeed while skipping all remaining
initialization like reset deassertion, IRQ registration, and IIO device
registration.

Should ret be explicitly set to a negative error code (like -ENODEV) before
calling dev_err_probe() if ret is 0?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260513-sunxi-a523-gpadc-v2-0-d5efde151dac@mmpsystems.pl?part=2

  parent reply	other threads:[~2026-05-14  2:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13  4:59 [PATCH v2 0/3] Add GPADC support for A523 Michal Piekos
2026-05-13  4:59 ` [PATCH v2 1/3] dt-bindings: iio: adc: Add GPADC for Allwinner A523 Michal Piekos
2026-05-13 19:15   ` Conor Dooley
2026-05-14  2:23   ` sashiko-bot
2026-05-13  4:59 ` [PATCH v2 2/3] iio: adc: sun20i-gpadc: add A523 gpadc support Michal Piekos
2026-05-13 11:44   ` Sanjay Chitroda
2026-05-13 11:53     ` Andre Przywara
2026-05-13 16:16       ` Jonathan Cameron
2026-05-13 21:34         ` Andre Przywara
2026-05-13 20:12       ` Andy Shevchenko
2026-05-13 21:19         ` Andre Przywara
2026-05-13 21:34           ` Andy Shevchenko
2026-05-13 20:10   ` Andy Shevchenko
2026-05-14  2:29   ` sashiko-bot [this message]
2026-05-13  4:59 ` [PATCH v2 3/3] arm64: dts: allwinner: a523: add gpadc node Michal Piekos
2026-05-14  2:42   ` sashiko-bot

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=20260514022938.5889BC19425@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=michal.piekos@mmpsystems.pl \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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