diff options
author | Julia Lawall <julia@diku.dk> | 2011-06-01 13:10:13 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-06-02 04:07:46 -0400 |
commit | 0057f1809d44b26765ec2374e0107a2f8ab256f5 (patch) | |
tree | a707d902b457825cf0acf44dbcd312bf9983df86 /drivers/video | |
parent | 609d3bbf044a6766f6505d8a29d4ed48020c014c (diff) |
drivers/video/pxa168fb.c: add missing clk_put
Add a label for error-handling code in the case where only clk_get has
succeeded. Rename the label failed to be consistent with the rest.
A simplified version of the semantic match that finds the missing clk_put
is as follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r exists@
expression e1,e2;
statement S;
@@
e1 = clk_get@p1(...);
... when != e1 = e2
when != clk_put(e1)
when any
if (...) { ... when != clk_put(e1)
when != if (...) { ... clk_put(e1) ... }
* return@p3 ...;
} else S
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/pxa168fb.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c index 35f61dd0cb3a..bb95ec56d25d 100644 --- a/drivers/video/pxa168fb.c +++ b/drivers/video/pxa168fb.c | |||
@@ -623,19 +623,21 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev) | |||
623 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 623 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
624 | if (res == NULL) { | 624 | if (res == NULL) { |
625 | dev_err(&pdev->dev, "no IO memory defined\n"); | 625 | dev_err(&pdev->dev, "no IO memory defined\n"); |
626 | return -ENOENT; | 626 | ret = -ENOENT; |
627 | goto failed_put_clk; | ||
627 | } | 628 | } |
628 | 629 | ||
629 | irq = platform_get_irq(pdev, 0); | 630 | irq = platform_get_irq(pdev, 0); |
630 | if (irq < 0) { | 631 | if (irq < 0) { |
631 | dev_err(&pdev->dev, "no IRQ defined\n"); | 632 | dev_err(&pdev->dev, "no IRQ defined\n"); |
632 | return -ENOENT; | 633 | ret = -ENOENT; |
634 | goto failed_put_clk; | ||
633 | } | 635 | } |
634 | 636 | ||
635 | info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev); | 637 | info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev); |
636 | if (info == NULL) { | 638 | if (info == NULL) { |
637 | clk_put(clk); | 639 | ret = -ENOMEM; |
638 | return -ENOMEM; | 640 | goto failed_put_clk; |
639 | } | 641 | } |
640 | 642 | ||
641 | /* Initialize private data */ | 643 | /* Initialize private data */ |
@@ -671,7 +673,7 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev) | |||
671 | fbi->reg_base = ioremap_nocache(res->start, resource_size(res)); | 673 | fbi->reg_base = ioremap_nocache(res->start, resource_size(res)); |
672 | if (fbi->reg_base == NULL) { | 674 | if (fbi->reg_base == NULL) { |
673 | ret = -ENOMEM; | 675 | ret = -ENOMEM; |
674 | goto failed; | 676 | goto failed_free_info; |
675 | } | 677 | } |
676 | 678 | ||
677 | /* | 679 | /* |
@@ -683,7 +685,7 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev) | |||
683 | &fbi->fb_start_dma, GFP_KERNEL); | 685 | &fbi->fb_start_dma, GFP_KERNEL); |
684 | if (info->screen_base == NULL) { | 686 | if (info->screen_base == NULL) { |
685 | ret = -ENOMEM; | 687 | ret = -ENOMEM; |
686 | goto failed; | 688 | goto failed_free_info; |
687 | } | 689 | } |
688 | 690 | ||
689 | info->fix.smem_start = (unsigned long)fbi->fb_start_dma; | 691 | info->fix.smem_start = (unsigned long)fbi->fb_start_dma; |
@@ -772,8 +774,9 @@ failed_free_clk: | |||
772 | failed_free_fbmem: | 774 | failed_free_fbmem: |
773 | dma_free_coherent(fbi->dev, info->fix.smem_len, | 775 | dma_free_coherent(fbi->dev, info->fix.smem_len, |
774 | info->screen_base, fbi->fb_start_dma); | 776 | info->screen_base, fbi->fb_start_dma); |
775 | failed: | 777 | failed_free_info: |
776 | kfree(info); | 778 | kfree(info); |
779 | failed_put_clk: | ||
777 | clk_put(clk); | 780 | clk_put(clk); |
778 | 781 | ||
779 | dev_err(&pdev->dev, "frame buffer device init failed with %d\n", ret); | 782 | dev_err(&pdev->dev, "frame buffer device init failed with %d\n", ret); |