diff mbox series

usb: typec: Return void in typec_partner_set_pd_revision

Message ID 20210202095512.761214-1-kyletso@google.com (mailing list archive)
State Accepted
Commit 32e9b48d110ef5fae850036eafaf7895a25b37e3
Headers show
Series usb: typec: Return void in typec_partner_set_pd_revision | expand

Commit Message

Kyle Tso Feb. 2, 2021, 9:55 a.m. UTC
typec_partner_set_pd_revision doesn't need any return value.

Fixes: 29b01295a829 ("usb: typec: Add typec_partner_set_pd_revision")
Signed-off-by: Kyle Tso <kyletso@google.com>
---
 drivers/usb/typec/class.c | 10 ++--------
 include/linux/usb/typec.h |  2 +-
 2 files changed, 3 insertions(+), 9 deletions(-)

Comments

Benson Leung Feb. 2, 2021, 3:02 p.m. UTC | #1
Hi Kyle,

On Tue, Feb 02, 2021 at 05:55:12PM +0800, Kyle Tso wrote:
> typec_partner_set_pd_revision doesn't need any return value.
> 
> Fixes: 29b01295a829 ("usb: typec: Add typec_partner_set_pd_revision")
> Signed-off-by: Kyle Tso <kyletso@google.com>

Review tags for <bleung@chromium.org>
Thanks for the quick fix!

Thanks,
Benson

> ---
>  drivers/usb/typec/class.c | 10 ++--------
>  include/linux/usb/typec.h |  2 +-
>  2 files changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
> index b6ceab3dc16b..a7d1bc83c2d4 100644
> --- a/drivers/usb/typec/class.c
> +++ b/drivers/usb/typec/class.c
> @@ -755,15 +755,11 @@ EXPORT_SYMBOL_GPL(typec_partner_set_identity);
>   *
>   * This routine is used to report that the PD revision of the port partner has
>   * become available.
> - *
> - * Returns 0 on success or negative error number on failure.
>   */
> -int typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision)
> +void typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision)
>  {
> -	int ret;
> -
>  	if (partner->pd_revision == pd_revision)
> -		return 0;
> +		return;
>  
>  	partner->pd_revision = pd_revision;
>  	sysfs_notify(&partner->dev.kobj, NULL, "usb_power_delivery_revision");
> @@ -773,8 +769,6 @@ int typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision
>  			     "supports_usb_power_delivery");
>  	}
>  	kobject_uevent(&partner->dev.kobj, KOBJ_CHANGE);
> -
> -	return 0;
>  }
>  EXPORT_SYMBOL_GPL(typec_partner_set_pd_revision);
>  
> diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
> index 4946eca742d5..a94df82ab62f 100644
> --- a/include/linux/usb/typec.h
> +++ b/include/linux/usb/typec.h
> @@ -126,7 +126,7 @@ struct typec_altmode_desc {
>  	enum typec_port_data	roles;
>  };
>  
> -int typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision);
> +void typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision);
>  int typec_partner_set_num_altmodes(struct typec_partner *partner, int num_altmodes);
>  struct typec_altmode
>  *typec_partner_register_altmode(struct typec_partner *partner,
> -- 
> 2.30.0.365.g02bc693789-goog
>
Greg KH Feb. 2, 2021, 3:09 p.m. UTC | #2
On Tue, Feb 02, 2021 at 07:02:52AM -0800, Benson Leung wrote:
> Hi Kyle,
> 
> On Tue, Feb 02, 2021 at 05:55:12PM +0800, Kyle Tso wrote:
> > typec_partner_set_pd_revision doesn't need any return value.
> > 
> > Fixes: 29b01295a829 ("usb: typec: Add typec_partner_set_pd_revision")
> > Signed-off-by: Kyle Tso <kyletso@google.com>
> 
> Review tags for <bleung@chromium.org>

What does that mean?

Please respond with a line that I can use...

thanks,

greg k-h
Benson Leung Feb. 2, 2021, 3:10 p.m. UTC | #3
On Tue, Feb 02, 2021 at 04:09:13PM +0100, Greg KH wrote:
> On Tue, Feb 02, 2021 at 07:02:52AM -0800, Benson Leung wrote:
> > Hi Kyle,
> > 
> > On Tue, Feb 02, 2021 at 05:55:12PM +0800, Kyle Tso wrote:
> > > typec_partner_set_pd_revision doesn't need any return value.
> > > 
> > > Fixes: 29b01295a829 ("usb: typec: Add typec_partner_set_pd_revision")
> > > Signed-off-by: Kyle Tso <kyletso@google.com>
> > 
> > Review tags for <bleung@chromium.org>
> 
> What does that mean?
> 
> Please respond with a line that I can use...
> 

Reviewed-by: Benson Leung <bleung@chromium.org>

Sorry. 

Benson

> thanks,
> 
> greg k-h
Heikki Krogerus Feb. 2, 2021, 3:20 p.m. UTC | #4
On Tue, Feb 02, 2021 at 05:55:12PM +0800, Kyle Tso wrote:
> typec_partner_set_pd_revision doesn't need any return value.
> 
> Fixes: 29b01295a829 ("usb: typec: Add typec_partner_set_pd_revision")
> Signed-off-by: Kyle Tso <kyletso@google.com>

Good catch.

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

> ---
>  drivers/usb/typec/class.c | 10 ++--------
>  include/linux/usb/typec.h |  2 +-
>  2 files changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
> index b6ceab3dc16b..a7d1bc83c2d4 100644
> --- a/drivers/usb/typec/class.c
> +++ b/drivers/usb/typec/class.c
> @@ -755,15 +755,11 @@ EXPORT_SYMBOL_GPL(typec_partner_set_identity);
>   *
>   * This routine is used to report that the PD revision of the port partner has
>   * become available.
> - *
> - * Returns 0 on success or negative error number on failure.
>   */
> -int typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision)
> +void typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision)
>  {
> -	int ret;
> -
>  	if (partner->pd_revision == pd_revision)
> -		return 0;
> +		return;
>  
>  	partner->pd_revision = pd_revision;
>  	sysfs_notify(&partner->dev.kobj, NULL, "usb_power_delivery_revision");
> @@ -773,8 +769,6 @@ int typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision
>  			     "supports_usb_power_delivery");
>  	}
>  	kobject_uevent(&partner->dev.kobj, KOBJ_CHANGE);
> -
> -	return 0;
>  }
>  EXPORT_SYMBOL_GPL(typec_partner_set_pd_revision);
>  
> diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
> index 4946eca742d5..a94df82ab62f 100644
> --- a/include/linux/usb/typec.h
> +++ b/include/linux/usb/typec.h
> @@ -126,7 +126,7 @@ struct typec_altmode_desc {
>  	enum typec_port_data	roles;
>  };
>  
> -int typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision);
> +void typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision);
>  int typec_partner_set_num_altmodes(struct typec_partner *partner, int num_altmodes);
>  struct typec_altmode
>  *typec_partner_register_altmode(struct typec_partner *partner,
> -- 
> 2.30.0.365.g02bc693789-goog

thanks,
Greg KH Feb. 2, 2021, 6:46 p.m. UTC | #5
On Tue, Feb 02, 2021 at 05:55:12PM +0800, Kyle Tso wrote:
> typec_partner_set_pd_revision doesn't need any return value.
> 
> Fixes: 29b01295a829 ("usb: typec: Add typec_partner_set_pd_revision")
> Signed-off-by: Kyle Tso <kyletso@google.com>

Thanks, now queued up.

greg k-h
diff mbox series

Patch

diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index b6ceab3dc16b..a7d1bc83c2d4 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -755,15 +755,11 @@  EXPORT_SYMBOL_GPL(typec_partner_set_identity);
  *
  * This routine is used to report that the PD revision of the port partner has
  * become available.
- *
- * Returns 0 on success or negative error number on failure.
  */
-int typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision)
+void typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision)
 {
-	int ret;
-
 	if (partner->pd_revision == pd_revision)
-		return 0;
+		return;
 
 	partner->pd_revision = pd_revision;
 	sysfs_notify(&partner->dev.kobj, NULL, "usb_power_delivery_revision");
@@ -773,8 +769,6 @@  int typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision
 			     "supports_usb_power_delivery");
 	}
 	kobject_uevent(&partner->dev.kobj, KOBJ_CHANGE);
-
-	return 0;
 }
 EXPORT_SYMBOL_GPL(typec_partner_set_pd_revision);
 
diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
index 4946eca742d5..a94df82ab62f 100644
--- a/include/linux/usb/typec.h
+++ b/include/linux/usb/typec.h
@@ -126,7 +126,7 @@  struct typec_altmode_desc {
 	enum typec_port_data	roles;
 };
 
-int typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision);
+void typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision);
 int typec_partner_set_num_altmodes(struct typec_partner *partner, int num_altmodes);
 struct typec_altmode
 *typec_partner_register_altmode(struct typec_partner *partner,