Re: [PATCH v3 2/2] usb: dwc3: drd: Improve dwc3_get_extcon() style

From: Andy Shevchenko
Date: Sun Dec 13 2020 - 06:31:13 EST


On Sun, Dec 13, 2020 at 5:27 AM Sam Protsenko
<semen.protsenko@xxxxxxxxxx> wrote:
>
> Commit c73b41955ee4 ("usb: dwc3: drd: Avoid error when extcon is

The previous change ("...

(because we don't know the actual commit id)

> missing") changed the code flow in dwc3_get_extcon() function, leading
> to unnecessary if-branch. This patch does housekeeping by reworking the
> code for obtaining extcon device from the "port" node. While at it, add

an extcon

> the comment from mentioned code block, explaining how checking the port
> availability helps to avoid the misleading error.

...

> + /*
> + * Try to get extcon device from USB PHY controller's "port" node.

an extcon
the USB

> + * Check if it has the "port" node first, to avoid printing the error
> + * message from underlying code, as it's a valid case: extcon device
> + * (and "port" node) may be missing in case of "usb-role-switch" or OTG
> + * mode.
> + */

To me it sounds like this should be in the previous patch.

--
With Best Regards,
Andy Shevchenko