usb: typec: ucsi: simplify partner's PD caps registration
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fri, 29 Mar 2024 06:15:37 +0000 (08:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Apr 2024 15:07:03 +0000 (17:07 +0200)
commit41e1cd1401fcd1f1ae9e47574af2d9fc44a870b3
tree19eb85db8c7e888515b21e030861e4b2dd65e117
parentc0f66d78f42353d38b9608c05f211cf0773d93ac
usb: typec: ucsi: simplify partner's PD caps registration

In a way similar to the previous commit, move
typec_partner_set_usb_power_delivery() to be called after reading the PD
caps. This also removes calls to
usb_power_delivery_unregister_capabilities() from the error path. Keep
all capabilities registered until they are cleared by
ucsi_unregister_partner_pdos().

Fixes: b04e1747fbcc ("usb: typec: ucsi: Register USB Power Delivery Capabilities")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240329-qcom-ucsi-fixes-v2-5-0f5d37ed04db@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi.c