]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit - drivers/power/supply/lp8727_charger.c
lp8727_charger: Cleanup _probe() and _remove()
authorKim, Milo <Milo.Kim@ti.com>
Fri, 31 Aug 2012 09:23:03 +0000 (09:23 +0000)
committerAnton Vorontsov <anton.vorontsov@linaro.org>
Fri, 21 Sep 2012 00:55:34 +0000 (17:55 -0700)
commitfb9adc5190d7605506ebc0e05351baa57365cc90
tree4b84b79e2c0abc2de7a9513a3aaaa7f884effae3
parent74727c571517692ae24d0562676f2c61a86b9090
lp8727_charger: Cleanup _probe() and _remove()

If the lp8727_register_psy() gets failed, registered interrupt handler
should be freed, but this is not complete solution. It has still problem.
Assume that the IRQ occurs while unregistering power supply devices. Then
the ISR will access to freed IRQ.

From Anton's opinion, it can be resolved if re-ordering the call sequence.

Register power supplies first, then create interrupt handler. Then no need
to free the IRQ in _probe(). Additionally goto statements can be removed
because those can be replaced with return statements.

The _remove() should be changed the sequence - in reverse order of
_probe()

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
drivers/power/lp8727_charger.c