| .. | .. |
|---|
| 48 | 48 | struct device *dev = &pdev->dev; |
|---|
| 49 | 49 | struct backlight_device *bd; |
|---|
| 50 | 50 | |
|---|
| 51 | | - bd = devm_backlight_device_register(dev, pdev->name, dev->parent, |
|---|
| 51 | + bd = devm_backlight_device_register(dev, pdev->name, dev, |
|---|
| 52 | 52 | dev_get_drvdata(dev->parent), |
|---|
| 53 | 53 | &rave_sp_backlight_ops, |
|---|
| 54 | 54 | &rave_sp_backlight_props); |
|---|
| 55 | 55 | if (IS_ERR(bd)) |
|---|
| 56 | 56 | return PTR_ERR(bd); |
|---|
| 57 | 57 | |
|---|
| 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); |
|---|
| 59 | 65 | |
|---|
| 60 | 66 | return 0; |
|---|
| 61 | 67 | } |
|---|