iio: dac: ad3552r: Use device_for_each_child_node_scoped()
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 30 Mar 2024 18:53:04 +0000 (18:53 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 6 Apr 2024 10:17:23 +0000 (11:17 +0100)
commit2d766e79ba2bd15e59ceda4b0596e369c9564948
tree481ee9b16450d340c127949bfd0cdeb0f6418434
parent6020ca4de8e5404b20f15a6d9873cd6eb5f6d8d6
iio: dac: ad3552r: 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.

Removing the goto err; statements also allows more extensive use of
dev_err_probe() further simplifying the code.

Cc: Mihail Chindris <mihail.chindris@analog.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240330185305.1319844-8-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ad3552r.c