Re: [PATCH 07/33] platform: Define platform_device_put cleanup handler

Gavin Shan
2025-11-10T01:03:49Z

On 11/7/25 10:34 PM, Ben Horgan wrote:
> Define a cleanup helper for use with __free to destroy platform devices
> automatically when the pointer goes out of scope. This is only intended to
> be used in error cases and so should be used with return_ptr() or
> no_free_ptr() directly to avoid the automatic destruction on success.
>
> A first use of this is introduced in a subsequent commit.
>
> Signed-off-by: Ben Horgan <ben.horgan@arm.com>
> ---
> include/linux/platform_device.h | 1 +
> 1 file changed, 1 insertion(+)
>
Reviewed-by: Gavin Shan <gshan@redhat.com>