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

Fenghua Yu fenghuay at nvidia.com
Wed Nov 12 12:32:38 PST 2025



On 11/7/25 04:34, 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 at arm.com>

Reviewed-by: Fenghua Yu <fenghuay at nvidia.com>
Tested-by: Fenghua Yu <fenghuay at nvidia.com>

Thanks.

-Fenghua



More information about the linux-arm-kernel mailing list