*** 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
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
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
On Tue, Jul 14, 2020 at 11:34:51AM +0800, Kyle Tso wrote:
> *** BLURB HERE ***
No blurb?
:(
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,
>
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;
> }
> }
>
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
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