aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2020-09-18 00:33:31 +0200
committerPavel Machek <pavel@ucw.cz>2020-09-26 21:56:42 +0200
commita2fc703cc955c6b4b6c7fbed42df62bbadc46422 (patch)
tree3ec5caf513c9f9646f4e6310e68223f4a005b248 /drivers/leds
parentleds: ns2: cosmetic variable rename (diff)
downloadlinux-dev-a2fc703cc955c6b4b6c7fbed42df62bbadc46422.tar.xz
linux-dev-a2fc703cc955c6b4b6c7fbed42df62bbadc46422.zip
leds: ns2: cosmetic change
Return directly instead of setting result and breaking. Signed-off-by: Marek 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: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-ns2.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c
index dde476420a73..912db40c5118 100644
--- a/drivers/leds/leds-ns2.c
+++ b/drivers/leds/leds-ns2.c
@@ -65,7 +65,6 @@ struct ns2_led {
static int ns2_led_get_mode(struct ns2_led *led, enum ns2_led_modes *mode)
{
int i;
- int ret = -EINVAL;
int cmd_level;
int slow_level;
@@ -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 &&
slow_level == led->modval[i].slow_level) {
*mode = led->modval[i].mode;
- ret = 0;
- break;
+ return 0;
}
}
- return ret;
+ return -EINVAL;
}
static void ns2_led_set_mode(struct ns2_led *led, enum ns2_led_modes mode)