summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>2026-01-09 19:57:56 +0300
committerHans Verkuil <hverkuil+cisco@kernel.org>2026-03-16 13:51:55 +0300
commit251475d98e36d8067d955cacc1aa08fbf89d13d2 (patch)
treebdb966dba6f62d28c8ff6a9055e8e9866952c710
parent01537c973d3aecd8f2e065e0449ef3e09495c917 (diff)
downloadlinux-251475d98e36d8067d955cacc1aa08fbf89d13d2.tar.xz
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>
-rw-r--r--drivers/media/platform/samsung/exynos4-is/fimc-is.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
index 14d84cc96831..b7d9bfedd590 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
@@ -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++;
}
}