hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/video/backlight/rave-sp-backlight.c
....@@ -48,14 +48,20 @@
4848 struct device *dev = &pdev->dev;
4949 struct backlight_device *bd;
5050
51
- bd = devm_backlight_device_register(dev, pdev->name, dev->parent,
51
+ bd = devm_backlight_device_register(dev, pdev->name, dev,
5252 dev_get_drvdata(dev->parent),
5353 &rave_sp_backlight_ops,
5454 &rave_sp_backlight_props);
5555 if (IS_ERR(bd))
5656 return PTR_ERR(bd);
5757
58
- backlight_update_status(bd);
58
+ /*
59
+ * If there is a phandle pointing to the device node we can
60
+ * assume that another device will manage the status changes.
61
+ * If not we make sure the backlight is in a consistent state.
62
+ */
63
+ if (!dev->of_node->phandle)
64
+ backlight_update_status(bd);
5965
6066 return 0;
6167 }