usb: phy: Factor out the usb charger initialization
authorBaolin Wang <baolin.wang@linaro.org>
Thu, 7 Dec 2017 05:26:14 +0000 (13:26 +0800)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 12 Dec 2017 11:04:03 +0000 (13:04 +0200)
commit655283a7f5e047f2541cbcd60eecada705931b1a
tree91384ae2de17a8f829f5f5eaac1d579a06304669
parent42bf02ec6e420e541af9a47437d0bdf961ca2972
usb: phy: Factor out the usb charger initialization

Factor out the guts of usb charger initialization into usb_charger_init()
function, to make the usb_add_extcon() only do the extcon related things.
Meanwhile we also should initialize the USB charger before registering
the extcon device, in case the extcon notification was issued earlier than
usb charger initialization.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/phy/phy.c