Re: [PATCH v2] ASoC: cpcap: use the platform OF node setter
From: Bartosz Golaszewski
Date: Thu Nov 05 2026 - 09:02:34 EST
On Thu, Nov 05, 2026 at 08:32:28PM +0800, Yige Jiang wrote:
> cpcap_codec_probe() gets the audio-codec child node and assigns it
> only to dev.of_node. Platform device release now puts dev.fwnode,
> so the acquired node reference is never returned.
>
> Use platform_device_set_of_node() to synchronize both fields and
> give the device its own reference. Use __free(device_node) to release
> the local lookup reference when probe returns. The device keeps the
> node until it is replaced or the platform device is released; a probe
> retry also drops the old device-owned reference.
>
> Fixes: 7b5b51b2b05c ("driver core: platform: count references to all kinds of firmware nodes")
> Signed-off-by: Yige Jiang <yigejiang86@xxxxxxxxx>
> ---
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>