iio: adc: ab8500-gpadc: Use device_for_each_child_node_scoped() to simplify erorr...
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 30 Mar 2024 19:08:44 +0000 (19:08 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 6 Apr 2024 10:29:06 +0000 (11:29 +0100)
commitf875790e6ae8b53e99530e6c7f7d9394c1f6b9ee
treef25e6caf0858b4143a086ee6cc0bad3992c32392
parent18abc64bfe0478716adcf0fd6b95ea4dbfe9f9e7
iio: adc: ab8500-gpadc: Use device_for_each_child_node_scoped() to simplify erorr paths.

This new loop definition automatically releases the handle on early exit
reducing the chance of bugs that cause resource leaks.

Cc: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240330190849.1321065-4-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ab8500-gpadc.c