summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/ld9040.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-07-26 04:12:01 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 07:57:08 +0400
commitef22f6a70c9186c8e25f757b0e8f7374b37f69bf (patch)
tree2a2dcaa322941a54059421a96d462fc3a8585354 /drivers/video/backlight/ld9040.c
parenta4c8aaa559733d03cb6bb4fa62c25ae756c53e94 (diff)
downloadlinux-ef22f6a70c9186c8e25f757b0e8f7374b37f69bf.tar.xz
backlight: set backlight type and max_brightness before backlights are registered
Since commit a19a6ee "backlight: Allow properties to be passed at registration" and commit bb7ca74 "backlight: add backlight type", we can set backlight type and max_brightness before backlights are registered. Some newly added drivers did not set it properly, let's fix it. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Matthew Garrett <mjg@redhat.com> Cc: Jingoo Han <jg1.han@samsung.com> Cc: Donghwa Lee <dh09.lee@samsung.com> Cc: InKi Dae <inki.dae@samsung.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/backlight/ld9040.c')
-rw-r--r--drivers/video/backlight/ld9040.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c
index 62bcde3c97f2..5934655eb1ff 100644
--- a/drivers/video/backlight/ld9040.c
+++ b/drivers/video/backlight/ld9040.c
@@ -668,6 +668,7 @@ static int ld9040_probe(struct spi_device *spi)
struct ld9040 *lcd = NULL;
struct lcd_device *ld = NULL;
struct backlight_device *bd = NULL;
+ struct backlight_properties props;
lcd = kzalloc(sizeof(struct ld9040), GFP_KERNEL);
if (!lcd)
@@ -699,14 +700,17 @@ static int ld9040_probe(struct spi_device *spi)
lcd->ld = ld;
+ memset(&props, 0, sizeof(struct backlight_properties));
+ props.type = BACKLIGHT_RAW;
+ props.max_brightness = MAX_BRIGHTNESS;
+
bd = backlight_device_register("ld9040-bl", &spi->dev,
- lcd, &ld9040_backlight_ops, NULL);
+ lcd, &ld9040_backlight_ops, &props);
if (IS_ERR(bd)) {
ret = PTR_ERR(bd);
goto out_unregister_lcd;
}
- bd->props.max_brightness = MAX_BRIGHTNESS;
bd->props.brightness = MAX_BRIGHTNESS;
lcd->bd = bd;