Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jerome Brunet" <jbrunet@baylibre.com>
Cc: robh@kernel.org, mfd@lists.linux.dev, lee@kernel.org,
	conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH RESEND v6 4/5] mfd: axp20x: Add support for AXP318W PMIC
Date: Wed, 12 Aug 2026 21:40:19 +0000	[thread overview]
Message-ID: <20260812214019.CDF921F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812-axp318-regulator-v6-4-d6b84b55c000@baylibre.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The corresponding regulator driver lacks support for `AXP318_ID`, causing the `axp20x-regulator` child device probe to fail.
- [Medium] The newly added `axp318_cells` array uses a hard-coded cell ID of 1 instead of using `PLATFORM_DEVID_AUTO`.
--

--- Patch [4]: [PATCH RESEND v6 4/5] mfd: axp20x: Add support for AXP318W PMIC ---
commit 5a33005ba66225f7df0e6747b0fcb9263e977f13
Author: Andre Przywara <andre.przywara@arm.com>

mfd: axp20x: Add support for AXP318W PMIC

This commit introduces MFD core and I2C support for the X-Powers AXP318W
PMIC. It defines regmap properties, interrupt maps, and adds the regulator
child device.

> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index 84839d4aa1ca5..ea00c0cdce58c 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c

[ ... ]

> @@ -1061,6 +1129,10 @@ static const struct mfd_cell axp313a_cells[] = {
>  	MFD_CELL_RES("axp313a-pek", axp313a_pek_resources),
>  };
>  
> +static const struct mfd_cell axp318_cells[] = {
> +	MFD_CELL_BASIC("axp20x-regulator", NULL, NULL, 0, 1),

[Severity: Medium]
Should this cell use PLATFORM_DEVID_AUTO instead of a hard-coded ID of 1?

Hard-coding cell IDs or mapping them to fixed instance numbers can lead to
device naming collisions in sysfs and driver load failures if multiple PMICs
defining the same cell name exist on the same board.

[Severity: High]
Will this child device successfully probe, or are the regulator driver
changes missing from this patch series?

When the MFD core registers the "axp20x-regulator" cell, the regulator driver's
axp20x_regulator_probe() is invoked. It checks the axp20x->variant, but since
AXP318_ID is not handled in the regulator driver:

drivers/regulator/axp20x-regulator.c:axp20x_regulator_probe() {
    ...
    switch (axp20x->variant) {
    ...
    default:
        dev_err(&pdev->dev, "Unsupported AXP variant: %d\n",
            axp20x->variant);
        return -EINVAL;
    }
}

It appears this will fall through to the default case, print an error,
and return -EINVAL unconditionally.

> +};
> +
>  static const struct mfd_cell axp717_cells[] = {
>  	MFD_CELL_NAME("axp20x-regulator"),

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260812-axp318-regulator-v6-0-d6b84b55c000@baylibre.com?part=4

  reply	other threads:[~2026-08-12 21:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 21:30 [PATCH RESEND v6 0/5] regulator: Add X-Powers AXP318W PMIC support Jerome Brunet
2026-08-12 21:30 ` [PATCH RESEND v6 1/5] mfd: axp20x: Constify axp313 and axp717 cells Jerome Brunet
2026-08-12 21:37   ` sashiko-bot
2026-08-12 21:30 ` [PATCH RESEND v6 2/5] mfd: axp20x-i2c: Fix i2c instantiation Jerome Brunet
2026-08-12 21:41   ` sashiko-bot
2026-08-12 21:30 ` [PATCH RESEND v6 3/5] dt-bindings: mfd: x-powers,axp152: Document AXP318W Jerome Brunet
2026-08-12 21:37   ` sashiko-bot
2026-08-12 21:30 ` [PATCH RESEND v6 4/5] mfd: axp20x: Add support for AXP318W PMIC Jerome Brunet
2026-08-12 21:40   ` sashiko-bot [this message]
2026-08-12 21:30 ` [PATCH RESEND v6 5/5] regulator: axp20x: add support for the AXP318W Jerome Brunet
2026-08-12 21:37   ` 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=20260812214019.CDF921F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=lee@kernel.org \
    --cc=mfd@lists.linux.dev \
    --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