device property: Add cleanup.h based fwnode_handle_put() scope based cleanup.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 17 Feb 2024 16:42:36 +0000 (16:42 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Mar 2024 19:50:08 +0000 (19:50 +0000)
commit59ed5e2d505bf5f9b4af64d0021cd0c96aec1f7c
tree1e907d26e37d893d4a82c97c61a93a9c0fcc729c
parent77fc5151f9c0e6068f1567b73d33e75a0c35333d
device property: Add cleanup.h based fwnode_handle_put() scope based cleanup.

Useful where the fwnode_handle was obtained from a call such as
fwnode_find_reference() as it will safely do nothing if IS_ERR() is true
and will automatically release the reference on the variable leaving
scope.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://lore.kernel.org/r/20240217164249.921878-3-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
include/linux/property.h