Skip to content

Commit

Permalink
leds: lp3952: Use 'if (ret)' pattern
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
andy-shev authored and jacek-anaszewski committed Mar 23, 2017
1 parent 9696217 commit f4363d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/leds/leds-lp3952.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f4363d8

Please sign in to comment.