aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2019-07-08 14:41:29 +0200
committerLee Jones <lee.jones@linaro.org>2019-08-12 09:11:10 +0100
commit865cac14c2dac2fa5f16d1781ca2746b0d323796 (patch)
tree40a03d3d50dfcbad1fe34759e471c351aac7b72d /drivers/video
parentLinus 5.3-rc1 (diff)
downloadlinux-dev-865cac14c2dac2fa5f16d1781ca2746b0d323796.tar.xz
linux-dev-865cac14c2dac2fa5f16d1781ca2746b0d323796.zip
backlight: rave-sp: Leave initial state and register with correct device
This way the backlight can be referenced through its device node and enabling/disabling can be managed through the panel driver. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/backlight/rave-sp-backlight.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/video/backlight/rave-sp-backlight.c b/drivers/video/backlight/rave-sp-backlight.c
index 462f14a1b19d..05b5f003a3d1 100644
--- a/drivers/video/backlight/rave-sp-backlight.c
+++ b/drivers/video/backlight/rave-sp-backlight.c
@@ -48,14 +48,20 @@ static int rave_sp_backlight_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct backlight_device *bd;
- bd = devm_backlight_device_register(dev, pdev->name, dev->parent,
+ bd = devm_backlight_device_register(dev, pdev->name, dev,
dev_get_drvdata(dev->parent),
&rave_sp_backlight_ops,
&rave_sp_backlight_props);
if (IS_ERR(bd))
return PTR_ERR(bd);
- backlight_update_status(bd);
+ /*
+ * If there is a phandle pointing to the device node we can
+ * assume that another device will manage the status changes.
+ * If not we make sure the backlight is in a consistent state.
+ */
+ if (!dev->of_node->phandle)
+ backlight_update_status(bd);
return 0;
}