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

leds: gpio: Refactor code to use devm_gpiod_get_index_optional()



Instead of checking for the specific error codes, replace
devm_gpiod_get_index() with devm_gpiod_get_index_optional().
In this case we just return all errors to the caller and
simply check for NULL in case if legacy GPIO is being used.
As the result the code is easier to read and maintain.

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231016161005.1471768-3-andriy.shevchenko@linux.intel.com


Signed-off-by: default avatarLee Jones <lee@kernel.org>
parent f5ad594e
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