diff options
Diffstat (limited to 'drivers/video/bf537-lq035.c')
-rw-r--r-- | drivers/video/bf537-lq035.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/video/bf537-lq035.c b/drivers/video/bf537-lq035.c index befbc80d11fc..7347aa1e5e4a 100644 --- a/drivers/video/bf537-lq035.c +++ b/drivers/video/bf537-lq035.c | |||
@@ -760,18 +760,20 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev) | |||
760 | bfin_lq035_fb.flags = FBINFO_DEFAULT; | 760 | bfin_lq035_fb.flags = FBINFO_DEFAULT; |
761 | 761 | ||
762 | 762 | ||
763 | bfin_lq035_fb.pseudo_palette = kzalloc(sizeof(u32) * 16, GFP_KERNEL); | 763 | bfin_lq035_fb.pseudo_palette = devm_kzalloc(&pdev->dev, |
764 | sizeof(u32) * 16, | ||
765 | GFP_KERNEL); | ||
764 | if (bfin_lq035_fb.pseudo_palette == NULL) { | 766 | if (bfin_lq035_fb.pseudo_palette == NULL) { |
765 | pr_err("failed to allocate pseudo_palette\n"); | 767 | pr_err("failed to allocate pseudo_palette\n"); |
766 | ret = -ENOMEM; | 768 | ret = -ENOMEM; |
767 | goto out_palette; | 769 | goto out_table; |
768 | } | 770 | } |
769 | 771 | ||
770 | if (fb_alloc_cmap(&bfin_lq035_fb.cmap, NBR_PALETTE, 0) < 0) { | 772 | if (fb_alloc_cmap(&bfin_lq035_fb.cmap, NBR_PALETTE, 0) < 0) { |
771 | pr_err("failed to allocate colormap (%d entries)\n", | 773 | pr_err("failed to allocate colormap (%d entries)\n", |
772 | NBR_PALETTE); | 774 | NBR_PALETTE); |
773 | ret = -EFAULT; | 775 | ret = -EFAULT; |
774 | goto out_cmap; | 776 | goto out_table; |
775 | } | 777 | } |
776 | 778 | ||
777 | if (register_framebuffer(&bfin_lq035_fb) < 0) { | 779 | if (register_framebuffer(&bfin_lq035_fb) < 0) { |
@@ -804,9 +806,6 @@ out_lcd: | |||
804 | unregister_framebuffer(&bfin_lq035_fb); | 806 | unregister_framebuffer(&bfin_lq035_fb); |
805 | out_reg: | 807 | out_reg: |
806 | fb_dealloc_cmap(&bfin_lq035_fb.cmap); | 808 | fb_dealloc_cmap(&bfin_lq035_fb.cmap); |
807 | out_cmap: | ||
808 | kfree(bfin_lq035_fb.pseudo_palette); | ||
809 | out_palette: | ||
810 | out_table: | 809 | out_table: |
811 | dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0); | 810 | dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0); |
812 | fb_buffer = NULL; | 811 | fb_buffer = NULL; |
@@ -834,7 +833,6 @@ static int __devexit bfin_lq035_remove(struct platform_device *pdev) | |||
834 | free_dma(CH_PPI); | 833 | free_dma(CH_PPI); |
835 | 834 | ||
836 | 835 | ||
837 | kfree(bfin_lq035_fb.pseudo_palette); | ||
838 | fb_dealloc_cmap(&bfin_lq035_fb.cmap); | 836 | fb_dealloc_cmap(&bfin_lq035_fb.cmap); |
839 | 837 | ||
840 | 838 | ||