summaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp3952.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-03-23 21:17:49 +0200
committerJacek Anaszewski <jacek.anaszewski@gmail.com>2017-03-23 20:33:59 +0100
commitf4363d810767fcbd0aaad2e1d456be5d76bf54eb (patch)
tree81aa95b596c45328521ee600313697b67c425176 /drivers/leds/leds-lp3952.c
parent96962178475ae8040f40dff3a44beb9f69181421 (diff)
downloadlinux-f4363d810767fcbd0aaad2e1d456be5d76bf54eb.tar.bz2
leds: lp3952: Use 'if (ret)' pattern
Instead of unusual "if (!ret)" use "if (ret)" in lp3952_get_label(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Diffstat (limited to 'drivers/leds/leds-lp3952.c')
-rw-r--r--drivers/leds/leds-lp3952.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/leds/leds-lp3952.c b/drivers/leds/leds-lp3952.c
index 5184436b8905..847f7f282126 100644
--- a/drivers/leds/leds-lp3952.c
+++ b/drivers/leds/leds-lp3952.c
@@ -102,10 +102,11 @@ static int lp3952_get_label(struct device *dev, const char *label, char *dest)
const char *str;
ret = device_property_read_string(dev, label, &str);
- if (!ret)
- strncpy(dest, str, LP3952_LABEL_MAX_LEN);
+ if (ret)
+ return ret;
- return ret;
+ strncpy(dest, str, LP3952_LABEL_MAX_LEN);
+ return 0;
}
static int lp3952_register_led_classdev(struct lp3952_led_array *priv)