Skip to content
Commit eb2294c3 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Bryan Wu
Browse files

leds: lp8860: make use of devm_gpiod_get_optional



The probe function open coded a bad variant of devm_gpiod_get_optional
using devm_gpiod_get and just ignoring all errors.
In contrast to that devm_gpiod_get_optional returns NULL if there was no
corresponding gpio specified in the device tree (or ACPI table) and
fails if there is an error (or GPIOLIB is not enabled).

Moreover since 39b2bbe3 (gpio: add flags argument to gpiod_get*()
functions) which appeared in v3.17-rc1, the gpiod_get* functions take an
additional parameter that allows to specify direction and initial value
for output which allows some simplification.

Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarBryan Wu <cooloney@gmail.com>
parent 0cd1b0c3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment