public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] thunderbolt: Switch to use device_property_count_uXX()
@ 2019-07-23 19:21 Andy Shevchenko
  2019-07-23 19:35 ` Yehezkel Bernat
  2019-08-06 10:42 ` Mika Westerberg
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2019-07-23 19:21 UTC (permalink / raw)
  To: Andreas Noever, Michael Jamet, Mika Westerberg, Yehezkel Bernat,
	linux-kernel
  Cc: Andy Shevchenko

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/thunderbolt/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
index 81e8ac4c5805..2366406e49ac 100644
--- a/drivers/thunderbolt/eeprom.c
+++ b/drivers/thunderbolt/eeprom.c
@@ -414,7 +414,7 @@ static int tb_drom_copy_efi(struct tb_switch *sw, u16 *size)
 	struct device *dev = &sw->tb->nhi->pdev->dev;
 	int len, res;
 
-	len = device_property_read_u8_array(dev, "ThunderboltDROM", NULL, 0);
+	len = device_property_count_u8(dev, "ThunderboltDROM");
 	if (len < 0 || len < sizeof(struct tb_drom_header))
 		return -EINVAL;
 
-- 
2.20.1


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

* Re: [PATCH v1] thunderbolt: Switch to use device_property_count_uXX()
  2019-07-23 19:21 [PATCH v1] thunderbolt: Switch to use device_property_count_uXX() Andy Shevchenko
@ 2019-07-23 19:35 ` Yehezkel Bernat
  2019-08-06 10:42 ` Mika Westerberg
  1 sibling, 0 replies; 3+ messages in thread
From: Yehezkel Bernat @ 2019-07-23 19:35 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Andreas Noever, Michael Jamet, Mika Westerberg, LKML

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

Acked-by: Yehezkel Bernat <YehezkelShB@gmail.com>

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

* Re: [PATCH v1] thunderbolt: Switch to use device_property_count_uXX()
  2019-07-23 19:21 [PATCH v1] thunderbolt: Switch to use device_property_count_uXX() Andy Shevchenko
  2019-07-23 19:35 ` Yehezkel Bernat
@ 2019-08-06 10:42 ` Mika Westerberg
  1 sibling, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2019-08-06 10:42 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Andreas Noever, Michael Jamet, Yehezkel Bernat, linux-kernel,
	Lukas Wunner

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

Applied, thanks!

> ---
>  drivers/thunderbolt/eeprom.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
> index 81e8ac4c5805..2366406e49ac 100644
> --- a/drivers/thunderbolt/eeprom.c
> +++ b/drivers/thunderbolt/eeprom.c
> @@ -414,7 +414,7 @@ static int tb_drom_copy_efi(struct tb_switch *sw, u16 *size)
>  	struct device *dev = &sw->tb->nhi->pdev->dev;
>  	int len, res;
>  
> -	len = device_property_read_u8_array(dev, "ThunderboltDROM", NULL, 0);
> +	len = device_property_count_u8(dev, "ThunderboltDROM");
>  	if (len < 0 || len < sizeof(struct tb_drom_header))
>  		return -EINVAL;
>  
> -- 
> 2.20.1

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

end of thread, other threads:[~2019-08-06 10:42 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:21 [PATCH v1] thunderbolt: Switch to use device_property_count_uXX() Andy Shevchenko
2019-07-23 19:35 ` Yehezkel Bernat
2019-08-06 10:42 ` Mika Westerberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox