leds: core: Refactor led_update_brightness() to use standard pattern
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 16 Oct 2023 15:30:51 +0000 (18:30 +0300)
committerLee Jones <lee@kernel.org>
Wed, 1 Nov 2023 11:29:18 +0000 (11:29 +0000)
commit49e50aad22aebaaca3ff7abbdd462deaf16c5f35
treee673db93587fa6b60d158d77834d8f6142b58965
parent78cbcfd8b13cefe089296d053f222934a53e153d
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Denis Osterland-Heim <denis.osterland@diehl.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20231016153051.1409074-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/led-core.c