From: Sebastian Hesselbarth Date: Tue, 14 Apr 2015 21:23:30 +0000 (-0700) Subject: leds: gpio: Fix device teardown on probe deferral X-Git-Tag: omap-for-v4.3/legacy-v2-signed~80^2~30 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65c6b7e3ab70effc150dacc9c2fbd6581925dd53;p=pandora-kernel.git 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: Sebastian Hesselbarth Acked-by: Jacek Anaszewski Signed-off-by: Bryan Wu --- Reading git-diff-tree failed