Re: [PATCH] phy: rockchip-typec: fix tcphy_get_mode error case

From: Vinod Koul
Date: Fri Feb 03 2023 - 06:43:59 EST


On 26-01-23, 00:10, Neill Kapron wrote:
> The existing logic in tcphy_get_mode() can cause the phy to be
> incorrectly configured to USB UFP or DisplayPort mode when
> extcon_get_state returns an error code.
>
> extcon_get_state() can return 0, 1, or a negative error code.
>
> It is possible to get into the failing state with an extcon driver
> which does not support the extcon connector id specified as the
> second argument to extcon_get_state().
>
> tcphy_get_mode()
> ->extcon_get_state()
> -->find_cable_index_by_id()
> --->return -EINVAL;

Applied, thanks

--
~Vinod