tcpm: Error handling for tcpm_register_partner_altmodes
Subsystems (3)
cover tcpm: Error handling for tcpm_register_partner_altmodes
*** BLURB HERE ***
Kyle Tso (2):
usb: typec: Comment correction for typec_partner_register_altmode
usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes
drivers/usb/typec/class.c | 2 +- drivers/usb/typec/tcpm/tcpm.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.27.0.389.gc38d7665816-goog
PATCH 1/2 usb: typec: Comment correction for typec_partner_register_altmode
typec_register_altmode returns ERR_PTR on failure.
--- drivers/usb/typec/class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/class.c +1 -1
@@ -580,7 +580,7 @@ EXPORT_SYMBOL_GPL(typec_partner_set_identity);* SVID listed in response to Discover Modes command need to be listed in an * array in @desc. * -* Returns handle to the alternate mode on success or NULL on failure. +* Returns handle to the alternate mode on success or ERR_PTR on failure. */ struct typec_altmode * typec_partner_register_altmode(struct typec_partner *partner,
Signature · 1 line
2.27.0.389.gc38d7665816-goog
PATCH 2/2 usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes
In reply to Kyle Tsotypec_partner_register_altmode returns ERR_PTR. Reset the pointer altmode to NULL on failure.
--- drivers/usb/typec/tcpm/tcpm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/typec/tcpm/tcpm.c +3 -1
@@ -1061,9 +1061,11 @@ static void tcpm_register_partner_altmodes(struct tcpm_port *port)for (i =0 ; i < modep->altmodes; i++) { altmode =typec_partner_register_altmode (port->partner, &modep->altmode_desc[i]); -if (!altmode) +if (IS_ERR (altmode)) {tcpm_log (port,"Failed to register partner SVID 0x%04x" , modep->altmode_desc[i].svid); + altmode =NULL ; + } port->partner_altmode[i] = altmode; } }
Signature · 1 line
2.27.0.389.gc38d7665816-goog
Greg KH
maintainerQuoted 1 line · Kyle Tso
*** BLURB HERE ***
No blurb?
:(
Re: [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode
In reply to Kyle TsoQuoted 3 lines · Kyle Tso
typec_register_altmodereturnsERR_PTRon failure.Signed-off-by Kyle Tso <[email protected]>
Quoted 18 lines
--- drivers/usb/typec/class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/typec/class.c +1
-1@@ -580,7 +580,7 @@ EXPORT_SYMBOL_GPL(typec_partner_set_identity);* SVID listed in response to Discover Modes command need to be listed in an * array in @desc. * -* Returns handle to the alternate mode on success or NULL on failure. +* Returns handle to the alternate mode on success or ERR_PTR on failure. */ struct typec_altmode * typec_partner_register_altmode(struct typec_partner *partner,
Re: [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes
In reply to Kyle TsoQuoted 4 lines · Kyle Tso
typec_partner_register_altmodereturnsERR_PTR. Reset the pointer altmode to NULL on failure.Signed-off-by Kyle Tso <[email protected]>
Quoted 22 lines
--- drivers/usb/typec/tcpm/tcpm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/usb/typec/tcpm/tcpm.c +3
-1@@ -1061,9 +1061,11 @@ static void tcpm_register_partner_altmodes(struct tcpm_port *port)for (i =0 ; i < modep->altmodes; i++) { altmode =typec_partner_register_altmode (port->partner, &modep->altmode_desc[i]); -if (!altmode) +if (IS_ERR (altmode)) {tcpm_log (port,"Failed to register partner SVID 0x%04x" , modep->altmode_desc[i].svid); + altmode =NULL ; + } port->partner_altmode[i] = altmode; } }
Re: [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode
In reply to Kyle TsoQuoted 3 lines · Kyle Tso
typec_register_altmodereturnsERR_PTRon failure.Signed-off-by Kyle Tso <[email protected]>
Quoted 19 lines
--- drivers/usb/typec/class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/typec/class.c +1
-1@@ -580,7 +580,7 @@ EXPORT_SYMBOL_GPL(typec_partner_set_identity);* SVID listed in response to Discover Modes command need to be listed in an * array in @desc. * -* Returns handle to the alternate mode on success or NULL on failure. +* Returns handle to the alternate mode on success or ERR_PTR on failure. */ struct typec_altmode * typec_partner_register_altmode(struct typec_partner *partner,Signature · 1 line
2.27.0.389.gc38d7665816-goog
Signature · 1 line
heikki
Re: [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes
In reply to Kyle TsoQuoted 4 lines · Kyle Tso
typec_partner_register_altmodereturnsERR_PTR. Reset the pointer altmode to NULL on failure.Signed-off-by Kyle Tso <[email protected]>
Quoted 23 lines
--- drivers/usb/typec/tcpm/tcpm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/usb/typec/tcpm/tcpm.c +3
-1@@ -1061,9 +1061,11 @@ static void tcpm_register_partner_altmodes(struct tcpm_port *port)for (i =0 ; i < modep->altmodes; i++) { altmode =typec_partner_register_altmode (port->partner, &modep->altmode_desc[i]); -if (!altmode) +if (IS_ERR (altmode)) {tcpm_log (port,"Failed to register partner SVID 0x%04x" , modep->altmode_desc[i].svid); + altmode =NULL ; + } port->partner_altmode[i] = altmode; } }Signature · 1 line
2.27.0.389.gc38d7665816-goog
thanks,
Signature · 1 line
heikki