leds: lm3532: Switch to use fwnode_property_count_uXX()
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
@@ -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
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
@@ -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
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.Signed-off-by Andy Shevchenko <[email protected]>
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@@ -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 ;
PATCH 3/3 leds: lm3697: Switch to use fwnode_property_count_uXX()
In reply to Andy ShevchenkoUse 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
@@ -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
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.Signed-off-by Andy Shevchenko <[email protected]>
Quoted 20 lines
--- drivers/leds/leds-lm3697.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/leds/leds-lm3697.c +1
-4@@ -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 ;
Andy
Quoted 3 lines · Andy Shevchenko
Use
fwnode_property_count_uXX()directly, that makes code neater.Signed-off-by Andy Shevchenko <[email protected]>
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@@ -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 ;
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.Signed-off-by Andy Shevchenko <[email protected]>--- drivers/leds/leds-lm3532.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/leds/leds-lm3532.c +1
-4@@ -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