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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 9c5925927ece..5a24c6411d34 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -939,7 +939,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
939 ret = register_framebuffer(info); 939 ret = register_framebuffer(info);
940 if (ret < 0) { 940 if (ret < 0) {
941 dev_err(dev, "failed to register framebuffer device: %d\n", ret); 941 dev_err(dev, "failed to register framebuffer device: %d\n", ret);
942 goto free_cmap; 942 goto reset_drvdata;
943 } 943 }
944 944
945 /* add selected videomode to modelist */ 945 /* add selected videomode to modelist */
@@ -955,7 +955,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
955 955
956 return 0; 956 return 0;
957 957
958 958reset_drvdata:
959 dev_set_drvdata(dev, NULL);
959free_cmap: 960free_cmap:
960 fb_dealloc_cmap(&info->cmap); 961 fb_dealloc_cmap(&info->cmap);
961unregister_irqs: 962unregister_irqs:
@@ -992,10 +993,11 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
992{ 993{
993 struct device *dev = &pdev->dev; 994 struct device *dev = &pdev->dev;
994 struct fb_info *info = dev_get_drvdata(dev); 995 struct fb_info *info = dev_get_drvdata(dev);
995 struct atmel_lcdfb_info *sinfo = info->par; 996 struct atmel_lcdfb_info *sinfo;
996 997
997 if (!sinfo) 998 if (!info || !info->par)
998 return 0; 999 return 0;
1000 sinfo = info->par;
999 1001
1000 cancel_work_sync(&sinfo->task); 1002 cancel_work_sync(&sinfo->task);
1001 exit_backlight(sinfo); 1003 exit_backlight(sinfo);