]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4cf36f9d8b10262a10894b98f2a037d7514a8747
tree4b27f2cc3f0380211227c4a34b4889cfee384aea
parent963603bc16986168b1e9d7461b7ea5642d02800f
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