Skip to content

Commit

Permalink
video: fbdev: pxa168fb: Use devm_clk_get
Browse files Browse the repository at this point in the history
This patch introduces the use of managed resource function
devm_clk_get instead of clk_get and removes corresponding calls
to clk_put in the probe and remove functions.

To be compatible with the change various gotos are replaced with
direct returns, and unneeded label failed_put_clk is dropped.

Signed-off-by: Vaishali Thakkar <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
  • Loading branch information
v-thakkar authored and tomba committed Sep 1, 2015
1 parent c4e6774 commit 7b55408
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions drivers/video/fbdev/pxa168fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ static int pxa168fb_probe(struct platform_device *pdev)
return -EINVAL;
}

clk = clk_get(&pdev->dev, "LCDCLK");
clk = devm_clk_get(&pdev->dev, "LCDCLK");
if (IS_ERR(clk)) {
dev_err(&pdev->dev, "unable to get LCDCLK");
return PTR_ERR(clk);
Expand All @@ -624,21 +624,18 @@ static int pxa168fb_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) {
dev_err(&pdev->dev, "no IO memory defined\n");
ret = -ENOENT;
goto failed_put_clk;
return -ENOENT;
}

irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "no IRQ defined\n");
ret = -ENOENT;
goto failed_put_clk;
return -ENOENT;
}

info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev);
if (info == NULL) {
ret = -ENOMEM;
goto failed_put_clk;
return -ENOMEM;
}

/* Initialize private data */
Expand Down Expand Up @@ -776,8 +773,6 @@ static int pxa168fb_probe(struct platform_device *pdev)
info->screen_base, fbi->fb_start_dma);
failed_free_info:
kfree(info);
failed_put_clk:
clk_put(clk);

dev_err(&pdev->dev, "frame buffer device init failed with %d\n", ret);
return ret;
Expand Down Expand Up @@ -813,7 +808,6 @@ static int pxa168fb_remove(struct platform_device *pdev)
info->screen_base, info->fix.smem_start);

clk_disable(fbi->clk);
clk_put(fbi->clk);

framebuffer_release(info);

Expand Down

0 comments on commit 7b55408

Please sign in to comment.