Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] tcpm: Error handling for tcpm_register_partner_altmodes
@ 2020-07-14  3:34 Kyle Tso
  2020-07-14  3:34 ` [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode Kyle Tso
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kyle Tso @ 2020-07-14  3:34 UTC (permalink / raw)
  To: linux, heikki.krogerus, gregkh; +Cc: badhri, linux-usb, linux-kernel, Kyle Tso

*** 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


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

* [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode
  2020-07-14  3:34 [PATCH 0/2] tcpm: Error handling for tcpm_register_partner_altmodes Kyle Tso
@ 2020-07-14  3:34 ` Kyle Tso
  2020-07-14  6:48   ` Guenter Roeck
  2020-07-28 11:56   ` Heikki Krogerus
  2020-07-14  3:34 ` [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes Kyle Tso
  2020-07-14  6:02 ` [PATCH 0/2] " Greg KH
  2 siblings, 2 replies; 8+ messages in thread
From: Kyle Tso @ 2020-07-14  3:34 UTC (permalink / raw)
  To: linux, heikki.krogerus, gregkh; +Cc: badhri, linux-usb, linux-kernel, Kyle Tso

typec_register_altmode returns ERR_PTR on failure.

Signed-off-by: Kyle Tso <kyletso@google.com>
---
 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


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

* [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes
  2020-07-14  3:34 [PATCH 0/2] tcpm: Error handling for tcpm_register_partner_altmodes Kyle Tso
  2020-07-14  3:34 ` [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode Kyle Tso
@ 2020-07-14  3:34 ` Kyle Tso
  2020-07-14  6:49   ` Guenter Roeck
  2020-07-28 11:56   ` Heikki Krogerus
  2020-07-14  6:02 ` [PATCH 0/2] " Greg KH
  2 siblings, 2 replies; 8+ messages in thread
From: Kyle Tso @ 2020-07-14  3:34 UTC (permalink / raw)
  To: linux, heikki.krogerus, gregkh; +Cc: badhri, linux-usb, linux-kernel, Kyle Tso

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

Signed-off-by: Kyle Tso <kyletso@google.com>
---
 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


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

* Re: [PATCH 0/2] tcpm: Error handling for tcpm_register_partner_altmodes
  2020-07-14  3:34 [PATCH 0/2] tcpm: Error handling for tcpm_register_partner_altmodes Kyle Tso
  2020-07-14  3:34 ` [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode Kyle Tso
  2020-07-14  3:34 ` [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes Kyle Tso
@ 2020-07-14  6:02 ` Greg KH
  2 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2020-07-14  6:02 UTC (permalink / raw)
  To: Kyle Tso; +Cc: linux, heikki.krogerus, badhri, linux-usb, linux-kernel

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

No blurb?

:(

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

* Re: [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode
  2020-07-14  3:34 ` [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode Kyle Tso
@ 2020-07-14  6:48   ` Guenter Roeck
  2020-07-28 11:56   ` Heikki Krogerus
  1 sibling, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2020-07-14  6:48 UTC (permalink / raw)
  To: Kyle Tso, heikki.krogerus, gregkh; +Cc: badhri, linux-usb, linux-kernel

On 7/13/20 8:34 PM, Kyle Tso wrote:
> typec_register_altmode returns ERR_PTR on failure.
> 
> Signed-off-by: Kyle Tso <kyletso@google.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  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,
> 


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

* Re: [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes
  2020-07-14  3:34 ` [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes Kyle Tso
@ 2020-07-14  6:49   ` Guenter Roeck
  2020-07-28 11:56   ` Heikki Krogerus
  1 sibling, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2020-07-14  6:49 UTC (permalink / raw)
  To: Kyle Tso, heikki.krogerus, gregkh; +Cc: badhri, linux-usb, linux-kernel

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 <kyletso@google.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  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;
>  	}
>  }
> 


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

* Re: [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode
  2020-07-14  3:34 ` [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode Kyle Tso
  2020-07-14  6:48   ` Guenter Roeck
@ 2020-07-28 11:56   ` Heikki Krogerus
  1 sibling, 0 replies; 8+ messages in thread
From: Heikki Krogerus @ 2020-07-28 11:56 UTC (permalink / raw)
  To: Kyle Tso; +Cc: linux, gregkh, badhri, linux-usb, linux-kernel

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 <kyletso@google.com>

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

> ---
>  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

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

* Re: [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes
  2020-07-14  3:34 ` [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes Kyle Tso
  2020-07-14  6:49   ` Guenter Roeck
@ 2020-07-28 11:56   ` Heikki Krogerus
  1 sibling, 0 replies; 8+ messages in thread
From: Heikki Krogerus @ 2020-07-28 11:56 UTC (permalink / raw)
  To: Kyle Tso; +Cc: linux, gregkh, badhri, linux-usb, linux-kernel

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 <kyletso@google.com>

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

> ---
>  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

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

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14  3:34 [PATCH 0/2] tcpm: Error handling for tcpm_register_partner_altmodes Kyle Tso
2020-07-14  3:34 ` [PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode Kyle Tso
2020-07-14  6:48   ` Guenter Roeck
2020-07-28 11:56   ` Heikki Krogerus
2020-07-14  3:34 ` [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes Kyle Tso
2020-07-14  6:49   ` Guenter Roeck
2020-07-28 11:56   ` Heikki Krogerus
2020-07-14  6:02 ` [PATCH 0/2] " Greg KH

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git