aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/atmel_lcdfb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/atmel_lcdfb.c')
-rw-r--r--drivers/video/atmel_lcdfb.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 9c5925927ece..cedfd01c9833 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -378,6 +378,10 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
378 var->red.offset = 11; 378 var->red.offset = 11;
379 var->blue.offset = 0; 379 var->blue.offset = 0;
380 var->green.length = 6; 380 var->green.length = 6;
381 } else if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB555) {
382 var->red.offset = 10;
383 var->blue.offset = 0;
384 var->green.length = 5;
381 } else { 385 } else {
382 /* BGR:555 mode */ 386 /* BGR:555 mode */
383 var->red.offset = 0; 387 var->red.offset = 0;
@@ -939,7 +943,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
939 ret = register_framebuffer(info); 943 ret = register_framebuffer(info);
940 if (ret < 0) { 944 if (ret < 0) {
941 dev_err(dev, "failed to register framebuffer device: %d\n", ret); 945 dev_err(dev, "failed to register framebuffer device: %d\n", ret);
942 goto free_cmap; 946 goto reset_drvdata;
943 } 947 }
944 948
945 /* add selected videomode to modelist */ 949 /* add selected videomode to modelist */
@@ -955,7 +959,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
955 959
956 return 0; 960 return 0;
957 961
958 962reset_drvdata:
963 dev_set_drvdata(dev, NULL);
959free_cmap: 964free_cmap:
960 fb_dealloc_cmap(&info->cmap); 965 fb_dealloc_cmap(&info->cmap);
961unregister_irqs: 966unregister_irqs:
@@ -992,10 +997,11 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
992{ 997{
993 struct device *dev = &pdev->dev; 998 struct device *dev = &pdev->dev;
994 struct fb_info *info = dev_get_drvdata(dev); 999 struct fb_info *info = dev_get_drvdata(dev);
995 struct atmel_lcdfb_info *sinfo = info->par; 1000 struct atmel_lcdfb_info *sinfo;
996 1001
997 if (!sinfo) 1002 if (!info || !info->par)
998 return 0; 1003 return 0;
1004 sinfo = info->par;
999 1005
1000 cancel_work_sync(&sinfo->task); 1006 cancel_work_sync(&sinfo->task);
1001 exit_backlight(sinfo); 1007 exit_backlight(sinfo);