diff mbox series

usb: typec: Remove vdo[3] part of tps6598x_rx_identity_reg struct

Message ID 20210311124710.6563-1-mail@eliasrudberg.se
State New
Headers show
Series usb: typec: Remove vdo[3] part of tps6598x_rx_identity_reg struct | expand

Commit Message

Elias Rudberg March 11, 2021, 12:47 p.m. UTC
Remove the unused "u32 vdo[3]" part in the tps6598x_rx_identity_reg
struct. This helps avoid "failed to register partner" errors which
happen when tps6598x_read_partner_identity() fails because the
amount of data read is 12 bytes smaller than the struct size.
Note that vdo[3] is already in usb_pd_identity and hence
shouldn't be added to tps6598x_rx_identity_reg as well.

Fixes: f6c56ca91b92 ("usb: typec: Add the Product Type VDOs to struct usb_pd_identity")

Signed-off-by: Elias Rudberg <mail@eliasrudberg.se>
---
 drivers/usb/typec/tps6598x.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Guido Günther March 12, 2021, 12:50 p.m. UTC | #1
Hi,
On Thu, Mar 11, 2021 at 01:47:10PM +0100, Elias Rudberg wrote:
> Remove the unused "u32 vdo[3]" part in the tps6598x_rx_identity_reg
> struct. This helps avoid "failed to register partner" errors which
> happen when tps6598x_read_partner_identity() fails because the
> amount of data read is 12 bytes smaller than the struct size.
> Note that vdo[3] is already in usb_pd_identity and hence
> shouldn't be added to tps6598x_rx_identity_reg as well.
> 
> Fixes: f6c56ca91b92 ("usb: typec: Add the Product Type VDOs to struct usb_pd_identity")
> 
> Signed-off-by: Elias Rudberg <mail@eliasrudberg.se>
> ---
>  drivers/usb/typec/tps6598x.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c
> index 6e6ef6317523..29bd1c5a283c 100644
> --- a/drivers/usb/typec/tps6598x.c
> +++ b/drivers/usb/typec/tps6598x.c
> @@ -64,7 +64,6 @@ enum {
>  struct tps6598x_rx_identity_reg {
>  	u8 status;
>  	struct usb_pd_identity identity;
> -	u32 vdo[3];
>  } __packed;
>  
>  /* Standard Task return codes */

Reviewed-by: Guido Günther <agx@sigxcpu.org>

Cheers,
 -- Guido

> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c
index 6e6ef6317523..29bd1c5a283c 100644
--- a/drivers/usb/typec/tps6598x.c
+++ b/drivers/usb/typec/tps6598x.c
@@ -64,7 +64,6 @@  enum {
 struct tps6598x_rx_identity_reg {
 	u8 status;
 	struct usb_pd_identity identity;
-	u32 vdo[3];
 } __packed;
 
 /* Standard Task return codes */