Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Paul Sajna" <sajattack@postmarketos.org>
Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org, lee@kernel.org
Subject: Re: [PATCH v6 3/3] leds: aw2013: Use dev_err_probe
Date: Fri, 13 Nov 2026 00:09:13 +0000	[thread overview]
Message-ID: <sashiko-outbox-211975@kernel.org> (raw)
In-Reply-To: <20261112-aw2013-aw20xx-rename-v6-3-251eca340abc@postmarketos.org>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] leds: aw2013: I2C write in aw2013_probe_dt() while regulators
  are disabled
- [Low] leds: aw2013: missed dev_err_probe() conversion in
  aw2013_probe()
--

commit 82b1ad2c2b840e1ab229066538d745664fd9ce9b
Author: Paul Sajna <sajattack@postmarketos.org>

leds: aw2013: Use dev_err_probe

This commit converts error logging in aw2013_probe() from dev_err() to
dev_err_probe().

> diff --git a/drivers/leds/leds-aw2013.c b/drivers/leds/leds-aw2013.c
> index 5ff9887086a61..f1106456d4edc 100644
> --- a/drivers/leds/leds-aw2013.c
> +++ b/drivers/leds/leds-aw2013.c

[ ... ]

> @@ -509,30 +508,29 @@ static int aw2013_probe(struct i2c_client *client)

[ ... ]

>  	if (chipid != chip->cdef->chip_id) {
> -		dev_err(&client->dev, "Chip reported wrong ID: %x\n",
> -			chipid);
> -		ret = -ENODEV;
> +		ret = dev_err_probe(&client->dev, -ENODEV,
> +				    "Chip reported wrong ID: %x\n",
> +				     chipid);
>  		goto error_reg;
>  	}

[Severity: Low]
Should the regmap_write(chip->regmap, AW2013_RSTR, AW2013_RSTR_RESET) error
path immediately following this block also use dev_err_probe() for
consistency with the rest of aw2013_probe()?

> @@ -545,8 +543,8 @@ static int aw2013_probe(struct i2c_client *client)
>  	ret = regulator_bulk_disable(ARRAY_SIZE(chip->regulators),
>  				     chip->regulators);
>  	if (ret) {
> -		dev_err(&client->dev,
> -			"Failed to disable regulators: %d\n", ret);
> +		ret = dev_err_probe(&client->dev, ret,
> +				    "Failed to disable regulators\n");
>  		goto error;
>  	}

[Severity: High]
Does aw2013_probe_dt() write to AW20XX_GCR2 over I2C after
regulator_bulk_disable() has powered down the vcc and vio supplies?

drivers/leds/leds-aw2013.c:aw2013_probe_dt() {
	...
	if (chip->cdef->gcr2_imax) {
		mutex_lock(&chip->mutex);
		ret = aw2027_set_global_imax(chip);
		if (ret) {
			mutex_unlock(&chip->mutex);
			return ret;
		}
		mutex_unlock(&chip->mutex);
	}
	...
}

On AW2027 boards with switchable vcc or vio regulators, this I2C access
While the supplies are disabled will fail and abort probe.  Since
aw2013_chip_init() already calls aw2027_set_global_imax() after enabling
the regulators and the chip, the call in aw2013_probe_dt() can be dropped.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112-aw2013-aw20xx-rename-v6-0-251eca340abc@postmarketos.org?part=3

      reply	other threads:[~2026-11-13  0:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13  0:01 [PATCH v6 0/3] leds: aw2013: Add AW2027 support Paul Sajna via B4 Relay
2026-11-13  0:01 ` [PATCH v6 1/3] dt-bindings: leds: aw2013: Add awinic,aw2027 compatible Paul Sajna via B4 Relay
2026-11-13  0:01 ` [PATCH v6 2/3] leds: aw2013: Add AW2027 support Paul Sajna via B4 Relay
2026-11-13  0:11   ` sashiko-bot
2026-11-13  0:01 ` [PATCH v6 3/3] leds: aw2013: Use dev_err_probe Paul Sajna via B4 Relay
2026-11-13  0:09   ` sashiko-bot [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=sashiko-outbox-211975@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sajattack@postmarketos.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