2020-07-14 03:36:47

by Kyle Tso

[permalink] [raw]
Subject: [PATCH 0/2] 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(-)

--
2.27.0.389.gc38d7665816-goog


2020-07-14 03:36:53

by Kyle Tso

[permalink] [raw]
Subject: [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode

typec_register_altmode returns ERR_PTR on failure.

Signed-off-by: Kyle Tso <[email protected]>
---
drivers/usb/typec/class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index c9234748537a..02655694f200 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -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,
--
2.27.0.389.gc38d7665816-goog

2020-07-14 03:39:56

by Kyle Tso

[permalink] [raw]
Subject: [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes

typec_partner_register_altmode returns ERR_PTR. Reset the pointer
altmode to NULL on failure.

Signed-off-by: Kyle Tso <[email protected]>
---
drivers/usb/typec/tcpm/tcpm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index 82b19ebd7838..a6d4b03ec250 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -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;
}
}
--
2.27.0.389.gc38d7665816-goog

2020-07-14 06:05:53

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 0/2] tcpm: Error handling for tcpm_register_partner_altmodes

On Tue, Jul 14, 2020 at 11:34:51AM +0800, Kyle Tso wrote:
> *** BLURB HERE ***

No blurb?

:(

2020-07-14 06:49:39

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode

On 7/13/20 8:34 PM, Kyle Tso wrote:
> typec_register_altmode returns ERR_PTR on failure.
>
> Signed-off-by: Kyle Tso <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> drivers/usb/typec/class.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
> index c9234748537a..02655694f200 100644
> --- a/drivers/usb/typec/class.c
> +++ b/drivers/usb/typec/class.c
> @@ -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,
>

2020-07-14 06:50:48

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes

On 7/13/20 8:34 PM, Kyle Tso wrote:
> typec_partner_register_altmode returns ERR_PTR. Reset the pointer
> altmode to NULL on failure.
>
> Signed-off-by: Kyle Tso <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> drivers/usb/typec/tcpm/tcpm.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 82b19ebd7838..a6d4b03ec250 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -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;
> }
> }
>

2020-07-28 12:11:36

by Heikki Krogerus

[permalink] [raw]
Subject: Re: [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes

On Tue, Jul 14, 2020 at 11:34:53AM +0800, Kyle Tso wrote:
> typec_partner_register_altmode returns ERR_PTR. Reset the pointer
> altmode to NULL on failure.
>
> Signed-off-by: Kyle Tso <[email protected]>

Reviewed-by: Heikki Krogerus <[email protected]>

> ---
> drivers/usb/typec/tcpm/tcpm.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 82b19ebd7838..a6d4b03ec250 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -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;
> }
> }
> --
> 2.27.0.389.gc38d7665816-goog

thanks,

--
heikki

2020-07-28 12:13:13

by Heikki Krogerus

[permalink] [raw]
Subject: Re: [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode

On Tue, Jul 14, 2020 at 11:34:52AM +0800, Kyle Tso wrote:
> typec_register_altmode returns ERR_PTR on failure.
>
> Signed-off-by: Kyle Tso <[email protected]>

Reviewed-by: Heikki Krogerus <[email protected]>

> ---
> drivers/usb/typec/class.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
> index c9234748537a..02655694f200 100644
> --- a/drivers/usb/typec/class.c
> +++ b/drivers/usb/typec/class.c
> @@ -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,
> --
> 2.27.0.389.gc38d7665816-goog

--
heikki