From: sashiko-bot@kernel.org
To: "Svyatoslav Ryhel" <clamor95@gmail.com>
Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
mfd@lists.linux.dev, dri-devel@lists.freedesktop.org,
robh@kernel.org, conor+dt@kernel.org, lee@kernel.org
Subject: Re: [PATCH v8 3/4] mfd: aat2870: Convert to use OF bindings
Date: Fri, 04 Dec 2026 06:26:14 +0000 [thread overview]
Message-ID: <sashiko-outbox-249210@kernel.org> (raw)
In-Reply-To: <20261204060605.20688-4-clamor95@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] mfd: aat2870: unchecked NULL of_node in aat2870_i2c_probe()
- [Low] mfd: aat2870: unused MFD_CORE select and missing OF Kconfig
dependency
--
commit 8eae6697bf7acb1c55037a0723f2cae6756c9ef2
Author: Svyatoslav Ryhel <clamor95@gmail.com>
mfd: aat2870: Convert to use OF bindings
This commit converts the AAT2870 MFD core, regulator, and backlight drivers
to use Device Tree bindings and gpiod helpers, removing platform data
support and the MFD cell registration table.
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index c7ff8997beb15..889155282b82f 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -130,7 +130,6 @@ config MFD_AAT2870_CORE
> select MFD_CORE
> depends on I2C=y
> depends on GPIOLIB || COMPILE_TEST
> - depends on GPIOLIB_LEGACY
> help
> If you say yes here you get support for the AAT2870.
> This driver provides common support for accessing the device,
[Severity: Low]
Should MFD_AAT2870_CORE drop select MFD_CORE and add a dependency on OF
(or OF || COMPILE_TEST)?
The driver no longer uses the MFD core API after switching to
devm_of_platform_populate(). Without CONFIG_OF_ADDRESS,
devm_of_platform_populate() compiles to a stub that unconditionally
returns -ENODEV, causing aat2870_i2c_probe() to always fail.
> diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
> index 5d43fd1da96e9..f5409dd91efb3 100644
> --- a/drivers/mfd/aat2870-core.c
> +++ b/drivers/mfd/aat2870-core.c
[ ... ]
> @@ -347,60 +307,27 @@ static int aat2870_i2c_probe(struct i2c_client *client)
[ ... ]
> + ret = devm_of_platform_populate(&client->dev);
> + if (ret) {
> + gpiod_set_value_cansleep(aat2870->en_pin, 0);
> + return dev_err_probe(&client->dev, ret, "Failed to populate cells\n");
> }
[Severity: Medium]
Can this populate the root Device Tree node and leak child devices if
client->dev.of_node is NULL?
Because aat2870_i2c_driver retains .id_table, an I2C client can still bind
without a Device Tree node (for example via sysfs new_device). When root
is NULL, of_platform_populate() falls back to of_find_node_by_path("/")
and populates top-level DT nodes under &client->dev.
On unbind, of_platform_depopulate() skips cleanup when parent->of_node is
NULL, leaking any devices populated during probe. Dropping .id_table or
returning an error when client->dev.of_node is NULL would prevent this.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204060605.20688-1-clamor95@gmail.com?part=3
next prev parent reply other threads:[~2026-12-04 6:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 6:06 [PATCH v8 0/4] mfd: aat2870: Convert to use OF bindings Svyatoslav Ryhel
2026-12-04 6:06 ` [PATCH v8 1/4] dt-bindings: leds: Document Skyworks AAT2870 Svyatoslav Ryhel
2026-12-04 6:14 ` sashiko-bot
2026-12-04 6:06 ` [PATCH v8 2/4] backlight: aat2870: Derive brightness steps from max current Svyatoslav Ryhel
2026-12-04 6:06 ` [PATCH v8 3/4] mfd: aat2870: Convert to use OF bindings Svyatoslav Ryhel
2026-12-04 6:26 ` sashiko-bot [this message]
2026-12-04 6:06 ` [PATCH v8 4/4] mfd: aat2870: Add support for VIN and IN-LDO power supplies Svyatoslav Ryhel
2026-12-04 6:19 ` sashiko-bot
2026-12-04 6:26 ` [PATCH v8 0/4] mfd: aat2870: Convert to use OF bindings 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=sashiko-outbox-249210@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=clamor95@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=lee@kernel.org \
--cc=linux-leds@vger.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