aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/ld9040.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/backlight/ld9040.c')
-rw-r--r--drivers/video/backlight/ld9040.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c
index 7281b2506a67..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)
668 struct ld9040 *lcd = NULL; 668 struct ld9040 *lcd = NULL;
669 struct lcd_device *ld = NULL; 669 struct lcd_device *ld = NULL;
670 struct backlight_device *bd = NULL; 670 struct backlight_device *bd = NULL;
671 struct backlight_properties props;
671 672
672 lcd = kzalloc(sizeof(struct ld9040), GFP_KERNEL); 673 lcd = kzalloc(sizeof(struct ld9040), GFP_KERNEL);
673 if (!lcd) 674 if (!lcd)
@@ -699,14 +700,17 @@ static int ld9040_probe(struct spi_device *spi)
699 700
700 lcd->ld = ld; 701 lcd->ld = ld;
701 702
703 memset(&props, 0, sizeof(struct backlight_properties));
704 props.type = BACKLIGHT_RAW;
705 props.max_brightness = MAX_BRIGHTNESS;
706
702 bd = backlight_device_register("ld9040-bl", &spi->dev, 707 bd = backlight_device_register("ld9040-bl", &spi->dev,
703 lcd, &ld9040_backlight_ops, NULL); 708 lcd, &ld9040_backlight_ops, &props);
704 if (IS_ERR(ld)) { 709 if (IS_ERR(bd)) {
705 ret = PTR_ERR(ld); 710 ret = PTR_ERR(bd);
706 goto out_free_lcd; 711 goto out_unregister_lcd;
707 } 712 }
708 713
709 bd->props.max_brightness = MAX_BRIGHTNESS;
710 bd->props.brightness = MAX_BRIGHTNESS; 714 bd->props.brightness = MAX_BRIGHTNESS;
711 lcd->bd = bd; 715 lcd->bd = bd;
712 716
@@ -731,6 +735,8 @@ static int ld9040_probe(struct spi_device *spi)
731 dev_info(&spi->dev, "ld9040 panel driver has been probed.\n"); 735 dev_info(&spi->dev, "ld9040 panel driver has been probed.\n");
732 return 0; 736 return 0;
733 737
738out_unregister_lcd:
739 lcd_device_unregister(lcd->ld);
734out_free_lcd: 740out_free_lcd:
735 kfree(lcd); 741 kfree(lcd);
736 return ret; 742 return ret;
@@ -741,6 +747,7 @@ static int __devexit ld9040_remove(struct spi_device *spi)
741 struct ld9040 *lcd = dev_get_drvdata(&spi->dev); 747 struct ld9040 *lcd = dev_get_drvdata(&spi->dev);
742 748
743 ld9040_power(lcd, FB_BLANK_POWERDOWN); 749 ld9040_power(lcd, FB_BLANK_POWERDOWN);
750 backlight_device_unregister(lcd->bd);
744 lcd_device_unregister(lcd->ld); 751 lcd_device_unregister(lcd->ld);
745 kfree(lcd); 752 kfree(lcd);
746 753