Re: [PATCH RFC 01/12] usb: typec: tcpm: qcom: Release the connector fwnode reference

From: Heikki Krogerus

Date: Mon Sep 28 2026 - 09:52:55 EST


Hi David,

On Sat, Sep 26, 2026 at 02:40:20PM +0200, David Heidelberg via B4 Relay wrote:
> From: David Heidelberg <david@xxxxxxx>
>
> device_get_named_child_node() returns the connector node with its
> reference count incremented, but the port probe never drops it. The node
> is only needed for the VBUS regulator lookup, so release it right after.
>
> Assisted-by: LLM
> Fixes: 506927b6bf29 ("usb: typec: tcpm: qcom: prefer VBUS supply from the connector node")
> Signed-off-by: David Heidelberg <david@xxxxxxx>

I think this should be send separately. Cc stable?

Acked-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>

Thanks,

> ---
> drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
> index bf985efe1cd6b..f8308d66b9d67 100644
> --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
> +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
> @@ -5,16 +5,17 @@
>
> #include <linux/delay.h>
> #include <linux/err.h>
> #include <linux/interrupt.h>
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/of.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> #include <linux/regmap.h>
> #include <linux/regulator/consumer.h>
> #include <linux/slab.h>
> #include <linux/string_choices.h>
> #include <linux/usb/tcpm.h>
> #include <linux/usb/typec_mux.h>
> #include <linux/workqueue.h>
>
> @@ -723,16 +724,17 @@ int qcom_pmic_typec_port_probe(struct platform_device *pdev,
>
> connector = device_get_named_child_node(dev, "connector");
> if (!connector)
> return -EINVAL;
>
> pmic_typec_port->vdd_vbus = devm_of_regulator_get_optional(dev,
> to_of_node(connector),
> "vbus");
> + fwnode_handle_put(connector);
> if (pmic_typec_port->vdd_vbus == ERR_PTR(-ENODEV))
> pmic_typec_port->vdd_vbus = devm_regulator_get(dev, "vdd-vbus");
> if (IS_ERR(pmic_typec_port->vdd_vbus))
> return PTR_ERR(pmic_typec_port->vdd_vbus);
>
> pmic_typec_port->dev = dev;
> pmic_typec_port->base = base;
> pmic_typec_port->regmap = regmap;
>
> --
> 2.55.0
>

--
heikki