regulator: da9063: Fix up irq leak
authorAxel Lin <axel.lin@ingics.com>
Sun, 31 May 2015 04:27:38 +0000 (12:27 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 2 Jun 2015 14:38:36 +0000 (15:38 +0100)
commitd87aef9164a57527f2ac36c226a4e60b20695656
treed031b189b6c2675c37f9469579d8036a9544472a
parentb787f68c36d49bb1d9236f403813641efa74a031
regulator: da9063: Fix up irq leak

Current code does not set regulators->irq_ldo_lim and regulators->irq_uvov,
so it actually calls free_irq(0, regulators) twice in remove() but does not
free the irq actually used.

Convert to use devm_request_threaded_irq instead and then we don't need to
take care the clean up irq so remove irq_ldo_lim and irq_uvov from
struct da9063_regulators. Note, regulators->irq_uvov is not used at all in
current code.

There is a slightly change in this patch, it will return error in probe()
if devm_request_threaded_irq fails. If the irq is optional, it should be
fine to allow platform_get_irq_byname fails. But current code does not
allow platform_get_irq_byname fails. So I think the reason to allow
request irq failure is just because the irq leak.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/da9063-regulator.c
This page took 0.024048 seconds and 5 git commands to generate.