Skip to content

Commit 4c15a4c

Browse files
ambarusvinodkoul
authored andcommitted
dmaengine: at_hdmac: Use devm_clk_get()
Clocks that are get with this method will be automatically put on driver detach. Use devm_clk_get() and simplify the error handling. Signed-off-by: Tudor Ambarus <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 8bfe4a6 commit 4c15a4c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/dma/at_hdmac.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,13 +1803,13 @@ static int __init at_dma_probe(struct platform_device *pdev)
18031803
atdma->dma_common.cap_mask = plat_dat->cap_mask;
18041804
atdma->all_chan_mask = (1 << plat_dat->nr_channels) - 1;
18051805

1806-
atdma->clk = clk_get(&pdev->dev, "dma_clk");
1806+
atdma->clk = devm_clk_get(&pdev->dev, "dma_clk");
18071807
if (IS_ERR(atdma->clk))
18081808
return PTR_ERR(atdma->clk);
18091809

18101810
err = clk_prepare_enable(atdma->clk);
18111811
if (err)
1812-
goto err_clk_prepare;
1812+
return err;
18131813

18141814
/* force dma off, just in case */
18151815
at_dma_off(atdma);
@@ -1942,8 +1942,6 @@ static int __init at_dma_probe(struct platform_device *pdev)
19421942
free_irq(platform_get_irq(pdev, 0), atdma);
19431943
err_irq:
19441944
clk_disable_unprepare(atdma->clk);
1945-
err_clk_prepare:
1946-
clk_put(atdma->clk);
19471945
return err;
19481946
}
19491947

@@ -1973,7 +1971,6 @@ static int at_dma_remove(struct platform_device *pdev)
19731971
}
19741972

19751973
clk_disable_unprepare(atdma->clk);
1976-
clk_put(atdma->clk);
19771974

19781975
return 0;
19791976
}

0 commit comments

Comments
 (0)