iio: temp: ltc2983: Use __free(fwnode_handle) and device_for_each_node_scoped()
This use of the new cleanup.h scope based freeing infrastructure allows us to exit directly from error conditions and in the good path with the reference obtained from fwnode_find_reference() (which may be an error pointer) automatically released. Similarly the _scoped() version of device_for_each_child_node() removes the need for the manual calling of fwnode_handl_put() in paths where the code exits the loop early. Tidy up some unusual indentation in a dev_dbg() whilst here. Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240224123215.161469-2-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Showing
This diff is collapsed.
Please register or sign in to comment