]> www.infradead.org Git - users/hch/misc.git/commit
leds: max77693: Add missing of_node_get for probe duration
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fri, 16 Aug 2024 15:31:35 +0000 (17:31 +0200)
committerLee Jones <lee@kernel.org>
Thu, 22 Aug 2024 13:22:54 +0000 (14:22 +0100)
commitd225d436f7baccde74ad80d9dc7f08e1271b8473
tree226fd866265c5223b8126c358ec22ec918184f43
parent700b6c984b418c04c63a54f67b6758b81016f0e3
leds: max77693: Add missing of_node_get for probe duration

At beginning of probe() function, the driver iterates over OF children
and assigns found device node for later.  The code uses
for_each_available_child_of_node() which drops the references on
children on each successful pass, thus the probe function operates later
on the device node without holding the reference.

Fix this by increasing the reference count for found child node and
drop it at the end of the probe, because it is not needed further (the
V4L init code takes its own references).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240816-cleanup-h-of-node-put-var-v1-3-1d0292802470@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/flash/leds-max77693.c