From: sashiko-bot@kernel.org
To: "Lakshay Piplani" <lakshay.piplani@nxp.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org,
linux-i3c@lists.infradead.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
Frank.Li@kernel.org
Subject: Re: [PATCH v15 5/8] regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x i3c hub
Date: Mon, 17 Aug 2026 10:51:57 +0000 [thread overview]
Message-ID: <20260817105157.694101F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260817103844.2142802-6-lakshay.piplani@nxp.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] MFD subsystem guide violation: driver-specific header in global include directory and use of bespoke parent context structure.
- [Low] The `p3h2x4x_regulators` array of regulator descriptors is not marked `const`.
--
--- Patch [5]: [PATCH v15 5/8] regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x i3c hub ---
commit 6bd5ced43bd70804c772227fde0c55395341c77d
Author: Aman Kumar Pandey <aman.kumarpandey@nxp.com>
regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x i3c hub
This patch introduces a new regulator driver for the NXP P3H2x4x I3C hub. It
registers the LDOs using the MFD framework and exposes them via the regulator
subsystem.
> diff --git a/drivers/regulator/p3h2840_i3c_hub_regulator.c b/drivers/regulator/p3h2840_i3c_hub_regulator.c
> new file mode 100644
> index 0000000000000..645d46ad7c2f2
> --- /dev/null
> +++ b/drivers/regulator/p3h2840_i3c_hub_regulator.c
> @@ -0,0 +1,284 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright 2025-2026 NXP
> + * NXP P3H2X4X regulator driver file contain functions for enable/disable regulator
> + * and voltage set/get.
> + */
> +#include <linux/bitfield.h>
> +#include <linux/cleanup.h>
> +#include <linux/mfd/p3h2840.h>
[Severity: Medium]
Should this header be kept local to drivers/mfd/ instead of placing it in the
global include/linux/mfd/ directory? The MFD subsystem guidelines recommend
against placing driver-specific header files in the global include directory
if they are only used by the parent and its immediate children.
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +#include <linux/regulator/driver.h>
[ ... ]
> +static const unsigned int p3h2x4x_voltage_table[] = {
> + 1000000,
> + 1100000,
> + 1200000,
> + 1800000,
> +};
> +
> +static struct regulator_desc p3h2x4x_regulators[] = {
[Severity: Low]
Could this array be marked const? Because devm_regulator_register() accepts a
const struct regulator_desc pointer, making this array const would move it to
the read-only .rodata section.
> + {
> + .name = "ldo-cp0",
> + .of_match = of_match_ptr("ldo-cp0"),
> + .regulators_node = of_match_ptr("regulators"),
[ ... ]
> + {
> + .name = "ldo-tpg1",
> + .of_match = of_match_ptr("ldo-tpg1"),
> + .regulators_node = of_match_ptr("regulators"),
> + .volt_table = p3h2x4x_voltage_table,
> + .n_voltages = ARRAY_SIZE(p3h2x4x_voltage_table),
> + .ops = &p3h2x4x_ldo_ops,
> + .type = REGULATOR_VOLTAGE,
> + .owner = THIS_MODULE,
> + .enable_reg = P3H2X4X_LDO_AND_PULLUP_CONF,
> + .enable_mask = P3H2X4X_TP2367_EN_LDO,
> + .vsel_reg = P3H2X4X_VCCIO_LDO_CONF,
> + .vsel_mask = P3H2X4X_TP2367_VCCIO_LDO_VOLTAGE_MASK,
> + },
> +};
> +
> +static int p3h2x4x_regulator_probe(struct platform_device *pdev)
> +{
> + struct p3h2x4x *p3h2x4x = dev_get_drvdata(pdev->dev.parent);
[Severity: Medium]
Is it possible to use standard APIs to access the required state rather than
exposing the bespoke parent struct p3h2x4x to the child drivers?
The MFD subsystem guidelines discourage exposing bespoke parent structures for
parent-child data sharing to maintain proper layering.
> + struct p3h2x4x_regulator_dev *p3h2x4x_regulator;
> + struct regulator_config rcfg = { };
> + struct device *dev = &pdev->dev;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260817103844.2142802-1-lakshay.piplani@nxp.com?part=5
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Lakshay Piplani" <lakshay.piplani@nxp.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org,
linux-i3c@lists.infradead.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
Frank.Li@kernel.org
Subject: Re: [PATCH v15 5/8] regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x i3c hub
Date: Mon, 17 Aug 2026 10:51:57 +0000 [thread overview]
Message-ID: <20260817105157.694101F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260817103844.2142802-6-lakshay.piplani@nxp.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] MFD subsystem guide violation: driver-specific header in global include directory and use of bespoke parent context structure.
- [Low] The `p3h2x4x_regulators` array of regulator descriptors is not marked `const`.
--
--- Patch [5]: [PATCH v15 5/8] regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x i3c hub ---
commit 6bd5ced43bd70804c772227fde0c55395341c77d
Author: Aman Kumar Pandey <aman.kumarpandey@nxp.com>
regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x i3c hub
This patch introduces a new regulator driver for the NXP P3H2x4x I3C hub. It
registers the LDOs using the MFD framework and exposes them via the regulator
subsystem.
> diff --git a/drivers/regulator/p3h2840_i3c_hub_regulator.c b/drivers/regulator/p3h2840_i3c_hub_regulator.c
> new file mode 100644
> index 0000000000000..645d46ad7c2f2
> --- /dev/null
> +++ b/drivers/regulator/p3h2840_i3c_hub_regulator.c
> @@ -0,0 +1,284 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright 2025-2026 NXP
> + * NXP P3H2X4X regulator driver file contain functions for enable/disable regulator
> + * and voltage set/get.
> + */
> +#include <linux/bitfield.h>
> +#include <linux/cleanup.h>
> +#include <linux/mfd/p3h2840.h>
[Severity: Medium]
Should this header be kept local to drivers/mfd/ instead of placing it in the
global include/linux/mfd/ directory? The MFD subsystem guidelines recommend
against placing driver-specific header files in the global include directory
if they are only used by the parent and its immediate children.
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +#include <linux/regulator/driver.h>
[ ... ]
> +static const unsigned int p3h2x4x_voltage_table[] = {
> + 1000000,
> + 1100000,
> + 1200000,
> + 1800000,
> +};
> +
> +static struct regulator_desc p3h2x4x_regulators[] = {
[Severity: Low]
Could this array be marked const? Because devm_regulator_register() accepts a
const struct regulator_desc pointer, making this array const would move it to
the read-only .rodata section.
> + {
> + .name = "ldo-cp0",
> + .of_match = of_match_ptr("ldo-cp0"),
> + .regulators_node = of_match_ptr("regulators"),
[ ... ]
> + {
> + .name = "ldo-tpg1",
> + .of_match = of_match_ptr("ldo-tpg1"),
> + .regulators_node = of_match_ptr("regulators"),
> + .volt_table = p3h2x4x_voltage_table,
> + .n_voltages = ARRAY_SIZE(p3h2x4x_voltage_table),
> + .ops = &p3h2x4x_ldo_ops,
> + .type = REGULATOR_VOLTAGE,
> + .owner = THIS_MODULE,
> + .enable_reg = P3H2X4X_LDO_AND_PULLUP_CONF,
> + .enable_mask = P3H2X4X_TP2367_EN_LDO,
> + .vsel_reg = P3H2X4X_VCCIO_LDO_CONF,
> + .vsel_mask = P3H2X4X_TP2367_VCCIO_LDO_VOLTAGE_MASK,
> + },
> +};
> +
> +static int p3h2x4x_regulator_probe(struct platform_device *pdev)
> +{
> + struct p3h2x4x *p3h2x4x = dev_get_drvdata(pdev->dev.parent);
[Severity: Medium]
Is it possible to use standard APIs to access the required state rather than
exposing the bespoke parent struct p3h2x4x to the child drivers?
The MFD subsystem guidelines discourage exposing bespoke parent structures for
parent-child data sharing to maintain proper layering.
> + struct p3h2x4x_regulator_dev *p3h2x4x_regulator;
> + struct regulator_config rcfg = { };
> + struct device *dev = &pdev->dev;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260817103844.2142802-1-lakshay.piplani@nxp.com?part=5
next prev parent reply other threads:[~2026-08-17 10:51 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 10:38 [PATCH v15 0/8] Add support for NXP P3H2x4x I3C hub driver Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:38 ` [PATCH v15 1/8] i3c: master: Add APIs for I3C hub support Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:50 ` sashiko-bot
2026-08-17 10:50 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 2/8] i3c: master: Add controller-only device operation helpers Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:50 ` sashiko-bot
2026-08-17 10:50 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 3/8] dt-bindings: i3c: Add NXP P3H2x4x i3c-hub support Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:49 ` sashiko-bot
2026-08-17 10:49 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 4/8] mfd: p3h2x4x: Add driver for NXP P3H2x4x i3c hub and on-die regulator Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:52 ` sashiko-bot
2026-08-17 10:52 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 5/8] regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x i3c hub Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:51 ` sashiko-bot [this message]
2026-08-17 10:51 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 6/8] i3c: hub: Add support for the I3C interface in the I3C hub Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:53 ` sashiko-bot
2026-08-17 10:53 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 7/8] i3c: hub: p3h2x4x: Add support for NXP P3H2x4x I3C hub functionality Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:51 ` sashiko-bot
2026-08-17 10:51 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 8/8] i3c: hub: p3h2x4x: Add SMBus slave mode support Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 11:04 ` sashiko-bot
2026-08-17 11:04 ` 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=20260817105157.694101F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lakshay.piplani@nxp.com \
--cc=linux-i3c@lists.infradead.org \
--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 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.