iio: adc: stm32: Use device_for_each_child_node_scoped()
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 30 Mar 2024 18:53:01 +0000 (18:53 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 13 Apr 2024 09:38:00 +0000 (10:38 +0100)
commit24622259e3a8f7df1972aafd801b888443e44363
tree0a09dcd414ead7b636211cc688ac304ea003b233
parent3735ca0b072656c3aa2cedc617a5e639b583a472
iio: adc: stm32: 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.

Note this would have made the bug fixed in the previous path much
less likely as it allows for direct returns.

Took advantage of dev_err_probe() to futher simplify things given no
longer a need for the goto err.

Cc: Olivier Moysan <olivier.moysan@foss.st.com>
Tested-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Acked-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20240330185305.1319844-5-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/stm32-adc.c