Re: [PATCH v2] regulator: as3722: use the platform OF node setter

From: Yige Jiang

Date: Sun Nov 08 2026 - 11:50:02 EST


Hi Mark,

You're right, sorry. I overlooked the fw_devlink implications here.
I reproduced a probe retry/rebind failure in a controlled QEMU test
with the actual driver.

Please drop v2. I have a draft of an alternative fix that I believe
would address the reference leak without changing the platform
device's node during probe. I'd be happy to post it separately as
v3 if that would be helpful.

I also noticed the same probe-time assignment in the applied CPCAP
patch and will follow up on that separately.

Thanks,
Yige
> On Nov 8, 2026, at 12:10 AM, Mark Brown <broonie@xxxxxxxxxx> wrote:
>
>> Use platform_device_set_of_node() to synchronize both fields and
>> give the device its own reference. Use __free(device_node) to release
>
>> static int as3722_get_regulator_dt_data(struct platform_device *pdev,
>> struct as3722_regulators *as3722_regs)
>> {
>
>> - pdev->dev.of_node = np;
>> + platform_device_set_of_node(pdev, np);
>
> Are you sure this is safe to use during probe(), which must of necessity
> happen after platform_device_add()? In particular with the interactions
> with fw_devlink.
>
> --
> Mark Brown <broonie@xxxxxxxxxx>