[PATCH v11 08/12] power: reset: qcom-pon: Migrate to devm_spmi_subdevice_alloc_and_add()

sashiko-bot at kernel.org sashiko-bot at kernel.org
Tue Jul 7 04:02:29 PDT 2026


Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The driver unconditionally fails to probe with `-ENODEV` due to an incorrect argument passed to `spmi_get_parent_spmi_device()`.
--

--- Patch [8]: [PATCH v11 08/12] power: reset: qcom-pon: Migrate to devm_spmi_subdevice_alloc_and_add() ---
commit b67b572fbf79a2d6627f6afc242b4580303b45ff
Author: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>

power: reset: qcom-pon: Migrate to devm_spmi_subdevice_alloc_and_add()

This commit registers a new SPMI sub-device for the Power On device to allow
handling of register base addresses using the regmap API, rather than
manually adding the base address on every read/write call.

> diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c
> index 7e108982a582e..314942d6cc882 100644
> --- a/drivers/power/reset/qcom-pon.c
> +++ b/drivers/power/reset/qcom-pon.c

[ ... ]

> @@ -56,17 +65,22 @@ static int qcom_pon_probe(struct platform_device *pdev)
>  
>  	pon->dev = &pdev->dev;
>  
> -	pon->regmap = dev_get_regmap(pdev->dev.parent, NULL);
> -	if (!pon->regmap) {
> -		dev_err(&pdev->dev, "failed to locate regmap\n");
> +	sparent = spmi_get_parent_spmi_device(dev->parent);
> +	if (!sparent)
>  		return -ENODEV;

[Severity: High]
Will this cause the probe to unconditionally fail?

The helper spmi_get_parent_spmi_device() expects to be passed the child
device so it can check its parent. By passing dev->parent, it appears the
helper will inspect the grandparent (the SPMI bus controller) instead.

Since the SPMI controller is of spmi_ctrl_type rather than spmi_dev_type,
does this mean sparent will always evaluate to NULL, causing the driver
to immediately abort with -ENODEV during initialization?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260707101821.173319-1-angelogioacchino.delregno@collabora.com?part=8



More information about the linux-phy mailing list