aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/adp5520_bl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/backlight/adp5520_bl.c')
-rw-r--r--drivers/video/backlight/adp5520_bl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c
index 86d95c228adb..9f436e014f85 100644
--- a/drivers/video/backlight/adp5520_bl.c
+++ b/drivers/video/backlight/adp5520_bl.c
@@ -12,6 +12,7 @@
12#include <linux/fb.h> 12#include <linux/fb.h>
13#include <linux/backlight.h> 13#include <linux/backlight.h>
14#include <linux/mfd/adp5520.h> 14#include <linux/mfd/adp5520.h>
15#include <linux/slab.h>
15 16
16struct adp5520_bl { 17struct adp5520_bl {
17 struct device *master; 18 struct device *master;
@@ -278,6 +279,7 @@ static const struct attribute_group adp5520_bl_attr_group = {
278 279
279static int __devinit adp5520_bl_probe(struct platform_device *pdev) 280static int __devinit adp5520_bl_probe(struct platform_device *pdev)
280{ 281{
282 struct backlight_properties props;
281 struct backlight_device *bl; 283 struct backlight_device *bl;
282 struct adp5520_bl *data; 284 struct adp5520_bl *data;
283 int ret = 0; 285 int ret = 0;
@@ -300,17 +302,17 @@ static int __devinit adp5520_bl_probe(struct platform_device *pdev)
300 302
301 mutex_init(&data->lock); 303 mutex_init(&data->lock);
302 304
303 bl = backlight_device_register(pdev->name, data->master, 305 memset(&props, 0, sizeof(struct backlight_properties));
304 data, &adp5520_bl_ops); 306 props.max_brightness = ADP5020_MAX_BRIGHTNESS;
307 bl = backlight_device_register(pdev->name, data->master, data,
308 &adp5520_bl_ops, &props);
305 if (IS_ERR(bl)) { 309 if (IS_ERR(bl)) {
306 dev_err(&pdev->dev, "failed to register backlight\n"); 310 dev_err(&pdev->dev, "failed to register backlight\n");
307 kfree(data); 311 kfree(data);
308 return PTR_ERR(bl); 312 return PTR_ERR(bl);
309 } 313 }
310 314
311 bl->props.max_brightness = 315 bl->props.brightness = ADP5020_MAX_BRIGHTNESS;
312 bl->props.brightness = ADP5020_MAX_BRIGHTNESS;
313
314 if (data->pdata->en_ambl_sens) 316 if (data->pdata->en_ambl_sens)
315 ret = sysfs_create_group(&bl->dev.kobj, 317 ret = sysfs_create_group(&bl->dev.kobj,
316 &adp5520_bl_attr_group); 318 &adp5520_bl_attr_group);