diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-03-23 20:17:49 +0100 |
---|---|---|
committer | Jacek Anaszewski <jacek.anaszewski@gmail.com> | 2017-03-23 20:33:59 +0100 |
commit | f4363d810767fcbd0aaad2e1d456be5d76bf54eb (patch) | |
tree | 81aa95b596c45328521ee600313697b67c425176 /drivers/leds | |
parent | leds: lp3952: Remove ACPI support for lp3952 (diff) | |
download | linux-f4363d810767fcbd0aaad2e1d456be5d76bf54eb.tar.xz linux-f4363d810767fcbd0aaad2e1d456be5d76bf54eb.zip |
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')
-rw-r--r-- | drivers/leds/leds-lp3952.c | 7 |
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) |