• Pali Rohár's avatar
    bq2415x_charger: Allow to load and use driver even if notify device is not registered yet · b68c3161
    Pali Rohár authored
    Driver bq2415x_charger works also without notify power supply device for
    charger detection. But when charger detection is specified in DT, then
    bq2415x_charger refused to loaded with -EPROBE_DEFER.
    
    This patch rewrites code so that notify device for charger detection is
    checked when power supply event is received and not when registering power
    supply device. So this patch allows to use bq2415x_charger driver also when
    kernel is compiled without driver for notify power supply device.
    
    Now after this patch scheduled workqueue is called after INIT_DELAYED_WORK,
    so it also fix problem when scheduled workqueue was called before init.
    Signed-off-by: default avatarPali Rohár <pali.rohar@gmail.com>
    Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
    b68c3161
bq2415x_charger.c 45.8 KB