media: samsung: exynos4-is: Simplify with scoped for each OF child loop

Use scoped for_each_compatible_node_scoped() loop when iterating over
device nodes to make code a bit simpler.

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
Krzysztof Kozlowski 2026-01-09 17:57:56 +01:00 committed by Hans Verkuil
parent 01537c973d
commit 251475d98e

View File

@ -200,21 +200,19 @@ static int fimc_is_parse_sensor_config(struct fimc_is *is, unsigned int index,
static int fimc_is_register_subdevs(struct fimc_is *is)
{
struct device_node *i2c_bus;
int ret, index = 0;
ret = fimc_isp_subdev_create(&is->isp);
if (ret < 0)
return ret;
for_each_compatible_node(i2c_bus, NULL, "samsung,exynos4212-i2c-isp") {
for_each_compatible_node_scoped(i2c_bus, NULL, "samsung,exynos4212-i2c-isp") {
for_each_available_child_of_node_scoped(i2c_bus, child) {
ret = fimc_is_parse_sensor_config(is, index, child);
if (ret < 0 || index >= FIMC_IS_SENSORS_NUM) {
of_node_put(i2c_bus);
if (ret < 0 || index >= FIMC_IS_SENSORS_NUM)
return ret;
}
index++;
}
}