lkml.org 
[lkml]   [2023]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v13 07/10] drm/bridge: anx7625: Register Type C mode switches
On Fri, Mar 03, 2023 at 10:33:47PM +0800, Pin-yen Lin wrote:
> Register USB Type-C mode switches when the "mode-switch" property and
> relevant ports are available in Device Tree. Configure the crosspoint
> switch based on the entered alternate mode for a specific Type-C
> connector.
>
> Crosspoint switch can also be used for switching the output signal for
> different orientations of a single USB Type-C connector, but the
> orientation switch is not implemented yet. A TODO is added for this.

...

> + ctx->port_data = devm_kcalloc(
> + dev, switch_desc->num_typec_switches,
> + sizeof(struct anx7625_typec_port_data), GFP_KERNEL);

I believe I have commented on this (indentation)...

> +

...and this (blank line).

> + if (!ctx->port_data) {
> + ret = -ENOMEM;
> + goto unregister_mux;
> + }

...

> + ctx->port_data[i].orientation = (dp_lanes[0] / 2 == 0) ?
> + TYPEC_ORIENTATION_REVERSE : TYPEC_ORIENTATION_NORMAL;

I believe that this is an error prone check, you should rather do the opposite,
i.e. ' % 2 == 0'.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2023-03-27 00:45    [W:0.248 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site