usb: typec: ucsi: always register a link to USB PD device
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fri, 29 Mar 2024 06:15:36 +0000 (08:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Apr 2024 15:07:03 +0000 (17:07 +0200)
commitc0f66d78f42353d38b9608c05f211cf0773d93ac
tree148b609ba0d446f5557bac60ed0bee09d78aaf01
parent9625607f15aa0c378c36c465dee1cfdf76941d08
usb: typec: ucsi: always register a link to USB PD device

UCSI driver will attempt to set a USB PD device only if it was able to
read PDOs from the firmware. This results in suboptimal behaviour, since
the PD device will be created anyway. Move calls to
typec_port_set_usb_power_delivery() out of conditional code and call it
after reading capabilities.

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-4-0f5d37ed04db@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi.c