• Kim, Milo's avatar
    lp8727_charger: Cleanup _probe() and _remove() · fb9adc51
    Kim, Milo authored
    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: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
    Signed-off-by: default avatarAnton Vorontsov <anton.vorontsov@linaro.org>
    fb9adc51
lp8727_charger.c 11.1 KB