diff mbox series

[v1] backlight: lm3630a: Switch to use fwnode_property_count_uXX()

Message ID 20190723193400.68851-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [v1] backlight: lm3630a: Switch to use fwnode_property_count_uXX() | expand

Commit Message

Andy Shevchenko July 23, 2019, 7:34 p.m. UTC
Use use fwnode_property_count_uXX() directly, that makes code neater.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/video/backlight/lm3630a_bl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Daniel Thompson July 24, 2019, 10:49 a.m. UTC | #1
On Tue, Jul 23, 2019 at 10:34:00PM +0300, Andy Shevchenko wrote:
> Use use fwnode_property_count_uXX() directly, that makes code neater.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


> ---
>  drivers/video/backlight/lm3630a_bl.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c
> index b04b35d007a2..2d8e8192e4e2 100644
> --- a/drivers/video/backlight/lm3630a_bl.c
> +++ b/drivers/video/backlight/lm3630a_bl.c
> @@ -377,8 +377,7 @@ static int lm3630a_parse_led_sources(struct fwnode_handle *node,
>  	u32 sources[LM3630A_NUM_SINKS];
>  	int ret, num_sources, i;
>  
> -	num_sources = fwnode_property_read_u32_array(node, "led-sources", NULL,
> -						     0);
> +	num_sources = fwnode_property_count_u32(node, "led-sources");
>  	if (num_sources < 0)
>  		return default_led_sources;
>  	else if (num_sources > ARRAY_SIZE(sources))
> -- 
> 2.20.1
>
Lee Jones Aug. 12, 2019, 8:04 a.m. UTC | #2
On Tue, 23 Jul 2019, Andy Shevchenko wrote:

> Use use fwnode_property_count_uXX() directly, that makes code neater.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/video/backlight/lm3630a_bl.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied, thanks.
Andy Shevchenko Sept. 2, 2019, 1:22 p.m. UTC | #3
On Mon, Aug 12, 2019 at 09:04:44AM +0100, Lee Jones wrote:
> On Tue, 23 Jul 2019, Andy Shevchenko wrote:
> 
> > Use use fwnode_property_count_uXX() directly, that makes code neater.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  drivers/video/backlight/lm3630a_bl.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> Applied, thanks.

Thanks.
However, I haven't still noticed a trace of it in Linux next.
Lee Jones Sept. 2, 2019, 2:56 p.m. UTC | #4
On Mon, 02 Sep 2019, Andy Shevchenko wrote:

> On Mon, Aug 12, 2019 at 09:04:44AM +0100, Lee Jones wrote:
> > On Tue, 23 Jul 2019, Andy Shevchenko wrote:
> > 
> > > Use use fwnode_property_count_uXX() directly, that makes code neater.
> > > 
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > ---
> > >  drivers/video/backlight/lm3630a_bl.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > Applied, thanks.
> 
> Thanks.
> However, I haven't still noticed a trace of it in Linux next.

Just did a big push.  It should be in there by tomorrow.
diff mbox series

Patch

diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c
index b04b35d007a2..2d8e8192e4e2 100644
--- a/drivers/video/backlight/lm3630a_bl.c
+++ b/drivers/video/backlight/lm3630a_bl.c
@@ -377,8 +377,7 @@  static int lm3630a_parse_led_sources(struct fwnode_handle *node,
 	u32 sources[LM3630A_NUM_SINKS];
 	int ret, num_sources, i;
 
-	num_sources = fwnode_property_read_u32_array(node, "led-sources", NULL,
-						     0);
+	num_sources = fwnode_property_count_u32(node, "led-sources");
 	if (num_sources < 0)
 		return default_led_sources;
 	else if (num_sources > ARRAY_SIZE(sources))