diff options
Diffstat (limited to 'drivers/video/backlight/da903x_bl.c')
-rw-r--r-- | drivers/video/backlight/da903x_bl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c index 74cdc640173d..686e4a789238 100644 --- a/drivers/video/backlight/da903x_bl.c +++ b/drivers/video/backlight/da903x_bl.c | |||
@@ -105,6 +105,7 @@ static int da903x_backlight_probe(struct platform_device *pdev) | |||
105 | struct da9034_backlight_pdata *pdata = pdev->dev.platform_data; | 105 | struct da9034_backlight_pdata *pdata = pdev->dev.platform_data; |
106 | struct da903x_backlight_data *data; | 106 | struct da903x_backlight_data *data; |
107 | struct backlight_device *bl; | 107 | struct backlight_device *bl; |
108 | struct backlight_properties props; | ||
108 | int max_brightness; | 109 | int max_brightness; |
109 | 110 | ||
110 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 111 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
@@ -134,15 +135,15 @@ static int da903x_backlight_probe(struct platform_device *pdev) | |||
134 | da903x_write(data->da903x_dev, DA9034_WLED_CONTROL2, | 135 | da903x_write(data->da903x_dev, DA9034_WLED_CONTROL2, |
135 | DA9034_WLED_ISET(pdata->output_current)); | 136 | DA9034_WLED_ISET(pdata->output_current)); |
136 | 137 | ||
137 | bl = backlight_device_register(pdev->name, data->da903x_dev, | 138 | props.max_brightness = max_brightness; |
138 | data, &da903x_backlight_ops); | 139 | bl = backlight_device_register(pdev->name, data->da903x_dev, data, |
140 | &da903x_backlight_ops, &props); | ||
139 | if (IS_ERR(bl)) { | 141 | if (IS_ERR(bl)) { |
140 | dev_err(&pdev->dev, "failed to register backlight\n"); | 142 | dev_err(&pdev->dev, "failed to register backlight\n"); |
141 | kfree(data); | 143 | kfree(data); |
142 | return PTR_ERR(bl); | 144 | return PTR_ERR(bl); |
143 | } | 145 | } |
144 | 146 | ||
145 | bl->props.max_brightness = max_brightness; | ||
146 | bl->props.brightness = max_brightness; | 147 | bl->props.brightness = max_brightness; |
147 | 148 | ||
148 | platform_set_drvdata(pdev, bl); | 149 | platform_set_drvdata(pdev, bl); |