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

From: Gavin Shan
Date: Sun Nov 09 2025 - 20:03:57 EST


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@xxxxxxx>
---
include/linux/platform_device.h | 1 +
1 file changed, 1 insertion(+)

Reviewed-by: Gavin Shan <gshan@xxxxxxxxxx>