mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 05:11:48 +00:00
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>
This commit is contained in:
parent
5f9e832c13
commit
865cac14c2
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user