leds: lm3532: Switch to use fwnode_property_count_uXX()

Use fwnode_property_count_uXX() directly, that makes code neater.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
This commit is contained in:
Andy Shevchenko 2019-07-23 23:14:57 +03:00 committed by Jacek Anaszewski
parent 1817208e14
commit cc93c86370

View File

@ -549,10 +549,7 @@ static int lm3532_parse_node(struct lm3532_data *priv)
lm3532_als_configure(priv, led);
}
led->num_leds = fwnode_property_read_u32_array(child,
"led-sources",
NULL, 0);
led->num_leds = fwnode_property_count_u32(child, "led-sources");
if (led->num_leds > LM3532_MAX_LED_STRINGS) {
dev_err(&priv->client->dev, "To many LED string defined\n");
continue;