Commit a2fc703c authored by Marek Behún's avatar Marek Behún Committed by Pavel Machek

leds: ns2: cosmetic change

Return directly instead of setting result and breaking.
Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
Cc: Simon Guinot <simon.guinot@sequanux.org>
Cc: Simon Guinot <sguinot@lacie.com>
Cc: Vincent Donnefort <vdonnefort@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent a78bd8f3
...@@ -65,7 +65,6 @@ struct ns2_led { ...@@ -65,7 +65,6 @@ struct ns2_led {
static int ns2_led_get_mode(struct ns2_led *led, enum ns2_led_modes *mode) static int ns2_led_get_mode(struct ns2_led *led, enum ns2_led_modes *mode)
{ {
int i; int i;
int ret = -EINVAL;
int cmd_level; int cmd_level;
int slow_level; int slow_level;
...@@ -76,12 +75,11 @@ static int ns2_led_get_mode(struct ns2_led *led, enum ns2_led_modes *mode) ...@@ -76,12 +75,11 @@ static int ns2_led_get_mode(struct ns2_led *led, enum ns2_led_modes *mode)
if (cmd_level == led->modval[i].cmd_level && if (cmd_level == led->modval[i].cmd_level &&
slow_level == led->modval[i].slow_level) { slow_level == led->modval[i].slow_level) {
*mode = led->modval[i].mode; *mode = led->modval[i].mode;
ret = 0; return 0;
break;
} }
} }
return ret; return -EINVAL;
} }
static void ns2_led_set_mode(struct ns2_led *led, enum ns2_led_modes mode) static void ns2_led_set_mode(struct ns2_led *led, enum ns2_led_modes mode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment