thunderbolt: Switch to use device_property_count_uXX()
PATCH 1/1 thunderbolt: Switch to use device_property_count_uXX()
Use use device_property_count_uXX() directly, that makes code neater.
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/thunderbolt/eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thunderbolt/eeprom.c +1 -1
@@ -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
Quoted 4 lines · Andy Shevchenko
Use use
device_property_count_uXX()directly, that makes code neater.Signed-off-by Andy Shevchenko <[email protected]>
Acked-by Yehezkel Bernat <[email protected]>
Mika Westerberg
AppliedQuoted 3 lines · Andy Shevchenko
Use use
device_property_count_uXX()directly, that makes code neater.Signed-off-by Andy Shevchenko <[email protected]>
Applied, thanks!
Quoted 19 lines
--- drivers/thunderbolt/eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/thunderbolt/eeprom.c +1
-1@@ -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