backlight: pwm_bl: Fix broken PWM backlight for non-dt platforms
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 10 Dec 2015 09:09:06 +0000 (10:09 +0100)
committerLee Jones <lee.jones@linaro.org>
Mon, 11 Jan 2016 06:36:43 +0000 (06:36 +0000)
commit8777078015bb77f0561303b6dea23d40bd9f3053
tree39bc51aee31750f606a4a84b036dfc94c98bfdbb
parentfcf13f0b9e4b54c51dff8366fc9a96d85129ff4c
backlight: pwm_bl: Fix broken PWM backlight for non-dt platforms

Commit ee65ad0e2a9e ("backlight: pwm_bl: Avoid backlight flicker when
probed from DT") tries to dereference the device of_node pointer
unconditionally, causing a NULL pointer dereference on non-dt platforms.
Fix it by replacing the phandle variable with a node variable and
by checking that for NULL before dereferencing it.

Reported-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/video/backlight/pwm_bl.c