diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-04-06 15:20:03 -0700 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2014-04-07 14:41:50 -0700 |
commit | 392369019eb96e914234ea21eda806cb51a1073e (patch) | |
tree | 7306c836d06f08d962251e1166875f855e3d2952 /Documentation/devicetree/bindings/mfd/mc13xxx.txt | |
parent | 0016db26c093798632ea741402215a31af447704 (diff) | |
download | op-kernel-dev-392369019eb96e914234ea21eda806cb51a1073e.zip op-kernel-dev-392369019eb96e914234ea21eda806cb51a1073e.tar.gz |
leds: leds-pwm: properly clean up after probe failure
When probing with DT, we add each LED one at a time. If we find a LED
without a PWM device (because it is not available yet) we fail the
initialisation, unregister previous LEDs, and then by way of managed
resources, we free the structure.
The problem with this is we may have a scheduled and active work_struct
in this structure, and this results in a nasty kernel oops.
We need to cancel this work_struct properly upon cleanup - and the
cleanup we require is the same cleanup as we do when the LED platform
device is removed. Rather than writing this same code three times,
move it into a separate function and use it in all three places.
Fixes: c971ff185f64 ("leds: leds-pwm: Defer led_pwm_set() if PWM can sleep")
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'Documentation/devicetree/bindings/mfd/mc13xxx.txt')
0 files changed, 0 insertions, 0 deletions