bq2415x_charger: Allow to load and use driver even if notify device is not registered yet
authorPali Rohár <pali.rohar@gmail.com>
Tue, 11 Aug 2015 11:22:19 +0000 (13:22 +0200)
committerSebastian Reichel <sre@kernel.org>
Fri, 21 Aug 2015 14:46:38 +0000 (16:46 +0200)
commitb68c3161430a4c7c0a001e658188bfea6a2fe5bd
tree4b27f2cc3f0380211227c4a34b4889cfee384aea
parentb49d15d138aa4632f35a2db93dee775d920f3653
bq2415x_charger: Allow to load and use driver even if notify device is not registered yet

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: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/bq2415x_charger.c