[PATCH v11 09/12] phy: qualcomm: eusb2-repeater: Migrate to devm_spmi_subdevice_alloc_and_add()

sashiko-bot at kernel.org sashiko-bot at kernel.org
Tue Jul 7 04:12:38 PDT 2026


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

--- Patch [9]: [PATCH v11 09/12] phy: qualcomm: eusb2-repeater: Migrate to devm_spmi_subdevice_alloc_and_add() ---
commit 18513faccc988052c6a64fb21c4bfcddad28f6e4
Author: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>

phy: qualcomm: eusb2-repeater: Migrate to devm_spmi_subdevice_alloc_and_add()

This patch registers a new SPMI sub-device for the EUSB2 repeater and
initializes its own regmap with the sub-device's specific base address
from the device tree, replacing the parent SPMI device syscon approach.

> diff --git a/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c b/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c
> index efeec4709a15d..a8542da2b4624 100644
> --- a/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c
> +++ b/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c
[ ... ]
> @@ -260,15 +265,21 @@ static int eusb2_repeater_probe(struct platform_device *pdev)
>  	if (!rptr->cfg)
>  		return -EINVAL;
>  
> -	rptr->regmap = dev_get_regmap(dev->parent, NULL);
> -	if (!rptr->regmap)
> +	sparent = spmi_get_parent_spmi_device(dev->parent);
> +	if (!sparent)
>  		return -ENODEV;

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

Since dev corresponds to the platform device (the SPMI sub-device), and
dev->parent is the PMIC (the actual SPMI device), passing dev->parent to
spmi_get_parent_spmi_device() makes it evaluate the grandparent of the
sub-device, which is the SPMI controller.

Because the controller's type is spmi_ctrl_type, the internal check for
parent->type == &spmi_dev_type will fail, returning NULL. 

Should this pass dev instead of dev->parent?

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



More information about the linux-phy mailing list