diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-03-30 18:52:59 +0000 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-04-13 10:38:05 +0100 |
commit | 77dc3b173d7258329e22ad8d8407bd5f8fe97fd1 (patch) | |
tree | 2ba395a43f00ed3de0e7570c4bd4f667bee2a845 /drivers/hid/hid-mcp2200.c | |
parent | 24622259e3a8f7df1972aafd801b888443e44363 (diff) |
iio: adc: qcom-spmi-adc5: Use device_for_each_child_node_scoped()
Switching to the _scoped() version removes the need for manual
calling of fwnode_handle_put() in the paths where the code
exits the loop early. In this case that's all in error paths.
A slightly less convincing usecase than many as all the failure paths
are wrapped up in a call to a per fwnode_handle utility function.
The complexity in that function is sufficient that it makes sense to
factor it out even if it this new auto cleanup would enable simpler
returns if the code was inline at the call site. Hence I've left it alone.
Cc: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240330185305.1319844-3-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/hid/hid-mcp2200.c')
0 files changed, 0 insertions, 0 deletions