Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 65c6b7e3 authored by Sebastian Hesselbarth's avatar Sebastian Hesselbarth Committed by Bryan Wu
Browse files

leds: gpio: Fix device teardown on probe deferral



In gpio_leds_create(), when devm_get_gpiod_from_child() fails with
-EPROBE_DEFER on the second gpio led to be created, the first already
registered led is not torn down properly. This causes create_gpio_led()
to fail for the first led on re-probe().

Fix this misbehaviour by incrementing num_leds only if all
potentially failing calls completed successfully.

Signed-off-by: default avatarSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: default avatarJacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: default avatarBryan Wu <cooloney@gmail.com>
parent e370d010
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment