Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 865cac14 authored by Lucas Stach's avatar Lucas Stach Committed by Lee Jones
Browse files

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: default avatarLucas Stach <l.stach@pengutronix.de>
Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 5f9e832c
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -48,13 +48,19 @@ 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);

	/*
	 * 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;