linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] usb: typec: tcpm: Switch to use fwnode_property_count_uXX()
@ 2019-07-23 19:37 Andy Shevchenko
  2019-07-23 20:17 ` Guenter Roeck
  2019-07-29 14:28 ` Heikki Krogerus
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2019-07-23 19:37 UTC (permalink / raw)
  To: Guenter Roeck, Heikki Krogerus, linux-usb, Greg Kroah-Hartman
  Cc: Andy Shevchenko

Use use fwnode_property_count_uXX() directly, that makes code neater.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/usb/typec/tcpm/tcpm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index fba32d84e578..ec525811a9eb 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -4410,8 +4410,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
 		goto sink;
 
 	/* Get source pdos */
-	ret = fwnode_property_read_u32_array(fwnode, "source-pdos",
-					     NULL, 0);
+	ret = fwnode_property_count_u32(fwnode, "source-pdos");
 	if (ret <= 0)
 		return -EINVAL;
 
@@ -4435,8 +4434,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
 		return -EINVAL;
 sink:
 	/* Get sink pdos */
-	ret = fwnode_property_read_u32_array(fwnode, "sink-pdos",
-					     NULL, 0);
+	ret = fwnode_property_count_u32(fwnode, "sink-pdos");
 	if (ret <= 0)
 		return -EINVAL;
 
-- 
2.20.1


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

* Re: [PATCH v1] usb: typec: tcpm: Switch to use fwnode_property_count_uXX()
  2019-07-23 19:37 [PATCH v1] usb: typec: tcpm: Switch to use fwnode_property_count_uXX() Andy Shevchenko
@ 2019-07-23 20:17 ` Guenter Roeck
  2019-07-29 14:28 ` Heikki Krogerus
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2019-07-23 20:17 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Heikki Krogerus, linux-usb, Greg Kroah-Hartman

On Tue, Jul 23, 2019 at 10:37:50PM +0300, Andy Shevchenko wrote:
> Use use fwnode_property_count_uXX() directly, that makes code neater.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index fba32d84e578..ec525811a9eb 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -4410,8 +4410,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
>  		goto sink;
>  
>  	/* Get source pdos */
> -	ret = fwnode_property_read_u32_array(fwnode, "source-pdos",
> -					     NULL, 0);
> +	ret = fwnode_property_count_u32(fwnode, "source-pdos");
>  	if (ret <= 0)
>  		return -EINVAL;
>  
> @@ -4435,8 +4434,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
>  		return -EINVAL;
>  sink:
>  	/* Get sink pdos */
> -	ret = fwnode_property_read_u32_array(fwnode, "sink-pdos",
> -					     NULL, 0);
> +	ret = fwnode_property_count_u32(fwnode, "sink-pdos");
>  	if (ret <= 0)
>  		return -EINVAL;
>  
> -- 
> 2.20.1
> 

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

* Re: [PATCH v1] usb: typec: tcpm: Switch to use fwnode_property_count_uXX()
  2019-07-23 19:37 [PATCH v1] usb: typec: tcpm: Switch to use fwnode_property_count_uXX() Andy Shevchenko
  2019-07-23 20:17 ` Guenter Roeck
@ 2019-07-29 14:28 ` Heikki Krogerus
  1 sibling, 0 replies; 3+ messages in thread
From: Heikki Krogerus @ 2019-07-29 14:28 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Guenter Roeck, linux-usb, Greg Kroah-Hartman

On Tue, Jul 23, 2019 at 10:37:50PM +0300, Andy Shevchenko wrote:
> Use use fwnode_property_count_uXX() directly, that makes code neater.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index fba32d84e578..ec525811a9eb 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -4410,8 +4410,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
>  		goto sink;
>  
>  	/* Get source pdos */
> -	ret = fwnode_property_read_u32_array(fwnode, "source-pdos",
> -					     NULL, 0);
> +	ret = fwnode_property_count_u32(fwnode, "source-pdos");
>  	if (ret <= 0)
>  		return -EINVAL;
>  
> @@ -4435,8 +4434,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
>  		return -EINVAL;
>  sink:
>  	/* Get sink pdos */
> -	ret = fwnode_property_read_u32_array(fwnode, "sink-pdos",
> -					     NULL, 0);
> +	ret = fwnode_property_count_u32(fwnode, "sink-pdos");
>  	if (ret <= 0)
>  		return -EINVAL;
>  
> -- 
> 2.20.1

thanks,

-- 
heikki

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

end of thread, other threads:[~2019-07-29 15:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23 19:37 [PATCH v1] usb: typec: tcpm: Switch to use fwnode_property_count_uXX() Andy Shevchenko
2019-07-23 20:17 ` Guenter Roeck
2019-07-29 14:28 ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).