From ef22f6a70c9186c8e25f757b0e8f7374b37f69bf Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 25 Jul 2011 17:12:01 -0700 Subject: 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 Cc: Matthew Garrett Cc: Jingoo Han Cc: Donghwa Lee Cc: InKi Dae Cc: Richard Purdie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/backlight/ams369fg06.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/video/backlight/ams369fg06.c') diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c index 2c314303f91..9f0a491e2a0 100644 --- a/drivers/video/backlight/ams369fg06.c +++ b/drivers/video/backlight/ams369fg06.c @@ -479,6 +479,7 @@ static int __devinit ams369fg06_probe(struct spi_device *spi) struct ams369fg06 *lcd = NULL; struct lcd_device *ld = NULL; struct backlight_device *bd = NULL; + struct backlight_properties props; lcd = kzalloc(sizeof(struct ams369fg06), GFP_KERNEL); if (!lcd) @@ -511,16 +512,18 @@ static int __devinit ams369fg06_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("ams369fg06-bl", &spi->dev, lcd, - &ams369fg06_backlight_ops, NULL); + &ams369fg06_backlight_ops, &props); if (IS_ERR(bd)) { ret = PTR_ERR(bd); goto out_lcd_unregister; } - bd->props.max_brightness = MAX_BRIGHTNESS; bd->props.brightness = DEFAULT_BRIGHTNESS; - bd->props.type = BACKLIGHT_RAW; lcd->bd = bd; if (!lcd->lcd_pd->lcd_enabled) { -- cgit v1.2.3