aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/pwm_bl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/backlight/pwm_bl.c')
-rw-r--r--drivers/video/backlight/pwm_bl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 9d2ec2a1cce8..b89eebc3f77d 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -65,6 +65,7 @@ static const struct backlight_ops pwm_backlight_ops = {
65 65
66static int pwm_backlight_probe(struct platform_device *pdev) 66static int pwm_backlight_probe(struct platform_device *pdev)
67{ 67{
68 struct backlight_properties props;
68 struct platform_pwm_backlight_data *data = pdev->dev.platform_data; 69 struct platform_pwm_backlight_data *data = pdev->dev.platform_data;
69 struct backlight_device *bl; 70 struct backlight_device *bl;
70 struct pwm_bl_data *pb; 71 struct pwm_bl_data *pb;
@@ -100,15 +101,16 @@ static int pwm_backlight_probe(struct platform_device *pdev)
100 } else 101 } else
101 dev_dbg(&pdev->dev, "got pwm for backlight\n"); 102 dev_dbg(&pdev->dev, "got pwm for backlight\n");
102 103
103 bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, 104 memset(&props, 0, sizeof(struct backlight_properties));
104 pb, &pwm_backlight_ops); 105 props.max_brightness = data->max_brightness;
106 bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, pb,
107 &pwm_backlight_ops, &props);
105 if (IS_ERR(bl)) { 108 if (IS_ERR(bl)) {
106 dev_err(&pdev->dev, "failed to register backlight\n"); 109 dev_err(&pdev->dev, "failed to register backlight\n");
107 ret = PTR_ERR(bl); 110 ret = PTR_ERR(bl);
108 goto err_bl; 111 goto err_bl;
109 } 112 }
110 113
111 bl->props.max_brightness = data->max_brightness;
112 bl->props.brightness = data->dft_brightness; 114 bl->props.brightness = data->dft_brightness;
113 backlight_update_status(bl); 115 backlight_update_status(bl);
114 116