This commit switches the fsmc_nand driver from clk_get() to
devm_clk_get(), which saves a few clk_put().
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
if (IS_ERR(host->regs_va))
return PTR_ERR(host->regs_va);
if (IS_ERR(host->regs_va))
return PTR_ERR(host->regs_va);
- host->clk = clk_get(&pdev->dev, NULL);
+ host->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(host->clk)) {
dev_err(&pdev->dev, "failed to fetch block clock\n");
return PTR_ERR(host->clk);
if (IS_ERR(host->clk)) {
dev_err(&pdev->dev, "failed to fetch block clock\n");
return PTR_ERR(host->clk);
ret = clk_prepare_enable(host->clk);
if (ret)
ret = clk_prepare_enable(host->clk);
if (ret)
- goto err_clk_prepare_enable;
/*
* This device ID is actually a common AMBA ID as used on the
/*
* This device ID is actually a common AMBA ID as used on the
dma_release_channel(host->read_dma_chan);
err_req_read_chnl:
clk_disable_unprepare(host->clk);
dma_release_channel(host->read_dma_chan);
err_req_read_chnl:
clk_disable_unprepare(host->clk);
-err_clk_prepare_enable:
- clk_put(host->clk);
dma_release_channel(host->read_dma_chan);
}
clk_disable_unprepare(host->clk);
dma_release_channel(host->read_dma_chan);
}
clk_disable_unprepare(host->clk);