Commit f4363d81 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jacek Anaszewski

leds: lp3952: Use 'if (ret)' pattern

Instead of unusual "if (!ret)" use "if (ret)" in lp3952_get_label().
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarJacek Anaszewski <jacek.anaszewski@gmail.com>
parent 96962178
......@@ -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;
strncpy(dest, str, LP3952_LABEL_MAX_LEN);
return 0;
}
static int lp3952_register_led_classdev(struct lp3952_led_array *priv)
......
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