mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] leds: max8997: use mode when calling max8997_led_set_mode
@ 2018-07-02 16:50 Colin King
  2018-07-02 20:24 ` Jacek Anaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-07-02 16:50 UTC (permalink / raw)
  To: Jacek Anaszewski, Pavel Machek; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable mode is assigned to pdata->led_pdata->mode[led->id] and yet
is not being used when calling function max8997_led_set_mode. Fix
this by using mode when calling max8997_led_set_mode.

Cleans up clang warning:
warning: variable 'mode' set but not used [-Wunused-but-set-variable]

Fixes: 8584cb82f151 ("leds: Add suuport for MAX8997-LED driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/leds/leds-max8997.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/leds-max8997.c b/drivers/leds/leds-max8997.c
index 4edf74f1d6d4..8c019c28f9f5 100644
--- a/drivers/leds/leds-max8997.c
+++ b/drivers/leds/leds-max8997.c
@@ -268,7 +268,7 @@ static int max8997_led_probe(struct platform_device *pdev)
 		mode = pdata->led_pdata->mode[led->id];
 		brightness = pdata->led_pdata->brightness[led->id];
 
-		max8997_led_set_mode(led, pdata->led_pdata->mode[led->id]);
+		max8997_led_set_mode(led, mode);
 
 		if (brightness > led->cdev.max_brightness)
 			brightness = led->cdev.max_brightness;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] leds: max8997: use mode when calling max8997_led_set_mode
  2018-07-02 16:50 [PATCH] leds: max8997: use mode when calling max8997_led_set_mode Colin King
@ 2018-07-02 20:24 ` Jacek Anaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Jacek Anaszewski @ 2018-07-02 20:24 UTC (permalink / raw)
  To: Colin King, Pavel Machek; +Cc: kernel-janitors, linux-kernel

Hi Colin,

Thank you for the patch.

On 07/02/2018 06:50 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable mode is assigned to pdata->led_pdata->mode[led->id] and yet
> is not being used when calling function max8997_led_set_mode. Fix
> this by using mode when calling max8997_led_set_mode.
> 
> Cleans up clang warning:
> warning: variable 'mode' set but not used [-Wunused-but-set-variable]
> 
> Fixes: 8584cb82f151 ("leds: Add suuport for MAX8997-LED driver")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/leds/leds-max8997.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/leds/leds-max8997.c b/drivers/leds/leds-max8997.c
> index 4edf74f1d6d4..8c019c28f9f5 100644
> --- a/drivers/leds/leds-max8997.c
> +++ b/drivers/leds/leds-max8997.c
> @@ -268,7 +268,7 @@ static int max8997_led_probe(struct platform_device *pdev)
>   		mode = pdata->led_pdata->mode[led->id];
>   		brightness = pdata->led_pdata->brightness[led->id];
>   
> -		max8997_led_set_mode(led, pdata->led_pdata->mode[led->id]);
> +		max8997_led_set_mode(led, mode);
>   
>   		if (brightness > led->cdev.max_brightness)
>   			brightness = led->cdev.max_brightness;
> 

Applied.

-- 
Best regards,
Jacek Anaszewski

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-02 20:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-02 16:50 [PATCH] leds: max8997: use mode when calling max8997_led_set_mode Colin King
2018-07-02 20:24 ` Jacek Anaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®