Skip to content
Commit 49e50aad authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Lee Jones
Browse files

leds: core: Refactor led_update_brightness() to use standard pattern



The standard conditional pattern is to check for errors first and
bail out if any. Refactor led_update_brightness() accordingly.

While at it, drop unneeded assignment and return 0 unconditionally
on success.

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarDenis Osterland-Heim <denis.osterland@diehl.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20231016153051.1409074-1-andriy.shevchenko@linux.intel.com


Signed-off-by: default avatarLee Jones <lee@kernel.org>
parent 78cbcfd8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment