The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v1] usb: typec: tcpm: Correct port source pdo array in pd_set callback
@ 2024-03-11 14:45 Kyle Tso
  2024-03-12 10:25 ` Heikki Krogerus
  0 siblings, 1 reply; 2+ messages in thread
From: Kyle Tso @ 2024-03-11 14:45 UTC (permalink / raw)
  To: linux, heikki.krogerus, gregkh
  Cc: badhri, linux-kernel, linux-usb, Kyle Tso, stable

In tcpm_pd_set, the array of port source capabilities is port->src_pdo,
not port->snk_pdo.

Fixes: cd099cde4ed2 ("usb: typec: tcpm: Support multiple capabilities")
Cc: stable@vger.kernel.org
Signed-off-by: Kyle Tso <kyletso@google.com>
---
 drivers/usb/typec/tcpm/tcpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index 3d505614bff1..9485f6373de4 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -6858,7 +6858,7 @@ static int tcpm_pd_set(struct typec_port *p, struct usb_power_delivery *pd)
 
 	if (data->source_desc.pdo[0]) {
 		for (i = 0; i < PDO_MAX_OBJECTS && data->source_desc.pdo[i]; i++)
-			port->snk_pdo[i] = data->source_desc.pdo[i];
+			port->src_pdo[i] = data->source_desc.pdo[i];
 		port->nr_src_pdo = i + 1;
 	}
 
-- 
2.44.0.278.ge034bb2e1d-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] usb: typec: tcpm: Correct port source pdo array in pd_set callback
  2024-03-11 14:45 [PATCH v1] usb: typec: tcpm: Correct port source pdo array in pd_set callback Kyle Tso
@ 2024-03-12 10:25 ` Heikki Krogerus
  0 siblings, 0 replies; 2+ messages in thread
From: Heikki Krogerus @ 2024-03-12 10:25 UTC (permalink / raw)
  To: Kyle Tso; +Cc: linux, gregkh, badhri, linux-kernel, linux-usb, stable

On Mon, Mar 11, 2024 at 10:45:00PM +0800, Kyle Tso wrote:
> In tcpm_pd_set, the array of port source capabilities is port->src_pdo,
> not port->snk_pdo.
> 
> Fixes: cd099cde4ed2 ("usb: typec: tcpm: Support multiple capabilities")
> Cc: stable@vger.kernel.org
> Signed-off-by: Kyle Tso <kyletso@google.com>

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 3d505614bff1..9485f6373de4 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -6858,7 +6858,7 @@ static int tcpm_pd_set(struct typec_port *p, struct usb_power_delivery *pd)
>  
>  	if (data->source_desc.pdo[0]) {
>  		for (i = 0; i < PDO_MAX_OBJECTS && data->source_desc.pdo[i]; i++)
> -			port->snk_pdo[i] = data->source_desc.pdo[i];
> +			port->src_pdo[i] = data->source_desc.pdo[i];
>  		port->nr_src_pdo = i + 1;
>  	}
>  
> -- 
> 2.44.0.278.ge034bb2e1d-goog

-- 
heikki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-12 10:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-11 14:45 [PATCH v1] usb: typec: tcpm: Correct port source pdo array in pd_set callback Kyle Tso
2024-03-12 10:25 ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox