From: Andy Shevchenko Date: Thu, 23 Mar 2017 19:17:49 +0000 (+0200) Subject: leds: lp3952: Use 'if (ret)' pattern X-Git-Tag: v4.14-rc1~1064^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f4363d810767fcbd0aaad2e1d456be5d76bf54eb;p=platform%2Fkernel%2Flinux-rpi.git leds: lp3952: Use 'if (ret)' pattern Instead of unusual "if (!ret)" use "if (ret)" in lp3952_get_label(). Signed-off-by: Andy Shevchenko Signed-off-by: Jacek Anaszewski --- diff --git a/drivers/leds/leds-lp3952.c b/drivers/leds/leds-lp3952.c index 5184436..847f7f2 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)