Skip to contentSkip to conversation

thunderbolt: Switch to use device_property_count_uXX()

PATCH Applied Andy Shevchenko 3 participants 3 messages Jul 23, 2019 – Aug 6, 2019 Thunderbolt driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thunderbolt: Switch to use device_property_count_uXX()

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

---
 drivers/thunderbolt/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thunderbolt/eeprom.c +1 -1
index 81e8ac4c5805..2366406e49ac 100644
@@ -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;
 
Signature · 1 line
2.20.1
#2 lore raw
In reply to Andy Shevchenko
Quoted 3 lines · Andy Shevchenko

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

Applied, thanks!

Quoted 19 lines
---
 drivers/thunderbolt/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thunderbolt/eeprom.c +1 -1
index 81e8ac4c5805..2366406e49ac 100644
@@ -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;
 
Signature · 1 line
2.20.1