aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/bf54x-lq043fb.c
diff options
context:
space:
mode:
authorDamien Cassou <damien.cassou@lifl.fr>2012-08-03 11:40:12 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2012-08-23 09:15:40 -0400
commitb7e69add39481dafb509a07ab527784d415b567b (patch)
tree88414890e533bcf4bfe0545e8568ebf055181307 /drivers/video/bf54x-lq043fb.c
parentb2ca7f4d740dc65322386b78cd5bdbceaa524fe0 (diff)
drivers/video/bf54x-lq043fb.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver detaches. This patch replaces the use of kzalloc by devm_kzalloc. Signed-off-by: Damien Cassou <damien.cassou@lifl.fr> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/bf54x-lq043fb.c')
-rw-r--r--drivers/video/bf54x-lq043fb.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c
index dc2f0047769b..47702ee0a797 100644
--- a/drivers/video/bf54x-lq043fb.c
+++ b/drivers/video/bf54x-lq043fb.c
@@ -601,7 +601,8 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
601 601
602 fbinfo->fbops = &bfin_bf54x_fb_ops; 602 fbinfo->fbops = &bfin_bf54x_fb_ops;
603 603
604 fbinfo->pseudo_palette = kzalloc(sizeof(u32) * 16, GFP_KERNEL); 604 fbinfo->pseudo_palette = devm_kzalloc(&pdev->dev, sizeof(u32) * 16,
605 GFP_KERNEL);
605 if (!fbinfo->pseudo_palette) { 606 if (!fbinfo->pseudo_palette) {
606 printk(KERN_ERR DRIVER_NAME 607 printk(KERN_ERR DRIVER_NAME
607 "Fail to allocate pseudo_palette\n"); 608 "Fail to allocate pseudo_palette\n");
@@ -616,7 +617,7 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
616 "Fail to allocate colormap (%d entries)\n", 617 "Fail to allocate colormap (%d entries)\n",
617 BFIN_LCD_NBR_PALETTE_ENTRIES); 618 BFIN_LCD_NBR_PALETTE_ENTRIES);
618 ret = -EFAULT; 619 ret = -EFAULT;
619 goto out5; 620 goto out4;
620 } 621 }
621 622
622 if (request_ports(info)) { 623 if (request_ports(info)) {
@@ -671,8 +672,6 @@ out7:
671 free_ports(info); 672 free_ports(info);
672out6: 673out6:
673 fb_dealloc_cmap(&fbinfo->cmap); 674 fb_dealloc_cmap(&fbinfo->cmap);
674out5:
675 kfree(fbinfo->pseudo_palette);
676out4: 675out4:
677 dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer, 676 dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer,
678 info->dma_handle); 677 info->dma_handle);
@@ -699,7 +698,6 @@ static int __devexit bfin_bf54x_remove(struct platform_device *pdev)
699 dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer, 698 dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer,
700 info->dma_handle); 699 info->dma_handle);
701 700
702 kfree(fbinfo->pseudo_palette);
703 fb_dealloc_cmap(&fbinfo->cmap); 701 fb_dealloc_cmap(&fbinfo->cmap);
704 702
705#ifndef NO_BL_SUPPORT 703#ifndef NO_BL_SUPPORT