All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jishnu Prakash" <jishnu.prakash@oss.qualcomm.com>
Cc: mfd@lists.linux.dev, devicetree@vger.kernel.org, robh@kernel.org,
	conor+dt@kernel.org, lee@kernel.org
Subject: Re: [PATCH v2 5/7] mfd: qcom-pm8008: Add PM8010 support
Date: Wed, 14 Oct 2026 10:44:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-171155@kernel.org> (raw)
In-Reply-To: <20261014-pm8010_i2c_support-v2-5-b395d2b3f668@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] mfd: silent fallback to PM8008 on non-DT PM8010 instances
--

commit 4e77301709b8663667033b7dfed82cf937a2d7c5
Author: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

mfd: qcom-pm8008: Add PM8010 support

This commit adds support for the PM8010 to the qcom-pm8008 driver. It
incorporates PM8010 specific IRQs, MFD cells, and match data to support the
new device type via I2C.

> diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c
> index 2d6c01cf54f32..4179427f38911 100644
> --- a/drivers/mfd/qcom-pm8008.c
> +++ b/drivers/mfd/qcom-pm8008.c
[ ... ]
> @@ -180,14 +218,36 @@ static void devm_irq_domain_fwnode_release(void *data)
>  static int pm8008_probe(struct i2c_client *client)
>  {
>  	struct regmap_irq_chip_data *irq_data;
> +	const struct regmap_irq_chip *irq_chip_desc;
>  	struct device *dev = &client->dev;
> +	const struct mfd_cell *mfd_cells;
>  	struct regmap *regmap, *regmap2;
>  	struct fwnode_handle *fwnode;
>  	struct i2c_client *dummy;
>  	struct gpio_desc *reset;
> +	unsigned long pmic_type;
> +	int num_mfd_cells;
>  	char *name;
>  	int ret;
>  
> +	pmic_type = (unsigned long)of_device_get_match_data(dev);

[Severity: Medium]
Will this silently fall back to TYPE_PM8008 for non-DT devices?

of_device_get_match_data() explicitly checks for dev->of_node and returns
NULL when it isn't present (such as devices instantiated via ACPI PRP0001
or swnodes). A NULL return evaluates to 0, which matches TYPE_PM8008 in
the switch below.

This means a valid qcom,pm8010-i2c device instantiated via ACPI or swnodes
will be misidentified as TYPE_PM8008 instead of TYPE_PM8010.

Could this use i2c_get_match_data() or device_get_match_data() to ensure
device variants are correctly extracted regardless of the underlying
firmware representation?

> +
> +	switch (pmic_type) {
> +	case TYPE_PM8008:
> +		irq_chip_desc = &pm8008_irq_chip;
> +		mfd_cells = pm8008_cells;
> +		num_mfd_cells = ARRAY_SIZE(pm8008_cells);
> +		break;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261014-pm8010_i2c_support-v2-0-b395d2b3f668@oss.qualcomm.com?part=5

  reply	other threads:[~2026-10-14 10:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 10:31 [PATCH v2 0/7] mfd: qcom-pm8008: Add support for PM8010 over I2C Jishnu Prakash
2026-10-14 10:31 ` [PATCH v2 1/7] dt-bindings: mfd: pm8008: Add qcom,pm8010-i2c compatible Jishnu Prakash
2026-10-14 10:31 ` [PATCH v2 2/7] regulator: pm8008: Add PM8010 support Jishnu Prakash
2026-10-14 10:32 ` [PATCH v2 3/7] regulator: qcom-pm8008: Add PM8010 mode support Jishnu Prakash
2026-10-14 10:45   ` sashiko-bot
2026-10-14 10:32 ` [PATCH v2 4/7] mfd: qcom-pm8008: Drop GPIO support Jishnu Prakash
2026-10-14 10:45   ` sashiko-bot
2026-10-14 10:32 ` [PATCH v2 5/7] mfd: qcom-pm8008: Add PM8010 support Jishnu Prakash
2026-10-14 10:44   ` sashiko-bot [this message]
2026-10-14 10:32 ` [PATCH v2 6/7] dt-bindings: mfd: pm8008: Make interrupts optional Jishnu Prakash
2026-10-14 10:32 ` [PATCH v2 7/7] mfd: qcom-pm8008: Tolerate missing interrupt Jishnu Prakash

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-171155@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jishnu.prakash@oss.qualcomm.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 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.