Skip to contentSkip to conversation

leds: lm3532: Switch to use fwnode_property_count_uXX()

PATCH In review Andy Shevchenko 3 participants 7 messages Jul 23, 2019 – Jul 24, 2019 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 leds: lm3532: Switch to use fwnode_property_count_uXX()

Use fwnode_property_count_uXX() directly, that makes code neater.

---
 drivers/leds/leds-lm3532.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/leds/leds-lm3532.c +1 -4
index 180895b83b88..646100724971 100644
@@ -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;
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/3 leds: lm36274: Switch to use fwnode_property_count_uXX()

Use fwnode_property_count_uXX() directly, that makes code neater.

---
 drivers/leds/leds-lm36274.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/leds/leds-lm36274.c +1 -3
index ed9dc857ec8f..836b60c9a2b8 100644
@@ -90,9 +90,7 @@ static int lm36274_parse_dt(struct lm36274 *lm36274_data)
 			snprintf(label, sizeof(label),
 				 "%s:%s", lm36274_data->pdev->name, name);
 
-		lm36274_data->num_leds = fwnode_property_read_u32_array(child,
-							  "led-sources",
-							  NULL, 0);
+		lm36274_data->num_leds = fwnode_property_count_u32(child, "led-sources");
 		if (lm36274_data->num_leds <= 0)
 			return -ENODEV;
 
Signature · 1 line
2.20.1
Acked-by on v1 2/3
#2 lore raw

Re: [PATCH v1 2/3] leds: lm36274: Switch to use fwnode_property_count_uXX()

Andy

Quoted 3 lines · Andy Shevchenko

Use fwnode_property_count_uXX() directly, that makes code neater.

Thanks for the update

Quoted 19 lines
---
  drivers/leds/leds-lm36274.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/leds/leds-lm36274.c +1 -3
index ed9dc857ec8f..836b60c9a2b8 100644
@@ -90,9 +90,7 @@ static int lm36274_parse_dt(struct lm36274 *lm36274_data)
  			snprintf(label, sizeof(label),
  				 "%s:%s", lm36274_data->pdev->name, name);
 
-		lm36274_data->num_leds = fwnode_property_read_u32_array(child,
-							  "led-sources",
-							  NULL, 0);
+		lm36274_data->num_leds = fwnode_property_count_u32(child, "led-sources");
  		if (lm36274_data->num_leds <= 0)
  			return -ENODEV;
 
#3 lore raw

PATCH 3/3 leds: lm3697: Switch to use fwnode_property_count_uXX()

In reply to Andy Shevchenko

Use fwnode_property_count_uXX() directly, that makes code neater.

---
 drivers/leds/leds-lm3697.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/leds/leds-lm3697.c +1 -4
index 54e0e35df824..b71711aff8a3 100644
@@ -244,10 +244,7 @@ static int lm3697_probe_dt(struct lm3697 *priv)
 		led->lmu_data.lsb_brightness_reg = LM3697_CTRL_A_BRT_LSB +
 						   led->control_bank * 2;
 
-		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 > LM3697_MAX_LED_STRINGS) {
 			dev_err(&priv->client->dev, "To many LED strings defined\n");
 			continue;
Signature · 1 line
2.20.1
Acked-by on v1 3/3
#4 lore raw

Re: [PATCH v1 3/3] leds: lm3697: Switch to use fwnode_property_count_uXX()

Andy

Quoted 3 lines · Andy Shevchenko

Use fwnode_property_count_uXX() directly, that makes code neater.

Quoted 20 lines
---
  drivers/leds/leds-lm3697.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)
drivers/leds/leds-lm3697.c +1 -4
index 54e0e35df824..b71711aff8a3 100644
@@ -244,10 +244,7 @@ static int lm3697_probe_dt(struct lm3697 *priv)
  		led->lmu_data.lsb_brightness_reg = LM3697_CTRL_A_BRT_LSB +
  						   led->control_bank * 2;
 
-		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 > LM3697_MAX_LED_STRINGS) {
  			dev_err(&priv->client->dev, "To many LED strings defined\n");
  			continue;
Acked-by on v1 1/3
#5 lore raw
In reply to Andy Shevchenko

Andy

Quoted 3 lines · Andy Shevchenko

Use fwnode_property_count_uXX() directly, that makes code neater.

Thanks for the update with the new call

Quoted 20 lines
---
  drivers/leds/leds-lm3532.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)
drivers/leds/leds-lm3532.c +1 -4
index 180895b83b88..646100724971 100644
@@ -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;
#6 lore raw
In reply to Andy Shevchenko

Hi Andy,

Thank you for the patch set.

Patches 1-3 applied.

Quoted 24 lines · Andy Shevchenko

Use fwnode_property_count_uXX() directly, that makes code neater.

---
 drivers/leds/leds-lm3532.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/leds/leds-lm3532.c +1 -4
index 180895b83b88..646100724971 100644
@@ -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;
Signature · 2 lines
Best regards,
Jacek Anaszewski