backlight: pwm_bl: Fix devicetree parsing with auto-generated brightness tables
authorHeiko Stuebner <heiko.stuebner@bq.com>
Mon, 12 Nov 2018 09:02:57 +0000 (10:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:08:50 +0000 (10:08 +0100)
commitd87fa3f7711b82245a6314efe9cd7d54981ef85c
tree199d1c47531d2fa2eea162378df6492c4d020c6d
parentf812bec554d0e17e587d89d8da8e240a2d41c62d
backlight: pwm_bl: Fix devicetree parsing with auto-generated brightness tables

[ Upstream commit 61170ee9386888f1e6f7e9cc58e8d9a8c2a3c1dd ]

Commit 88ba95bedb79 ("backlight: pwm_bl: Compute brightness of LED linearly
to human eye") made the parse-dt function return early when using an auto-
generated brightness-table, but didn't take into account that some more
settings were handled below the brightness handling, like power-on-delays
and also setting the pdata enable-gpio to -EINVAL.

This surfaces for example in the case of a backlight without any
enable-gpio which then tries to use gpio-0 in error.

Fix this by simply moving the trailing settings above the brightness
handling.

Fixes: 88ba95bedb79 ("backlight: pwm_bl: Compute brightness of LED linearly to human eye")
Signed-off-by: Heiko Stuebner <heiko.stuebner@bq.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/backlight/pwm_bl.c