diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2013-07-02 10:08:21 -0700 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-15 11:37:14 +0100 |
commit | e6eb8d9bb7b9c144ae63a5e97a686dd8a3377443 (patch) | |
tree | 190d379851b1edf1520e7f5ba6aa0108cf3c7847 /drivers | |
parent | d9b65dfd44fdade5c0fde5f7b8a0f267e99f990d (diff) | |
download | linux-e6eb8d9bb7b9c144ae63a5e97a686dd8a3377443.tar.bz2 |
spi: spi-ep93xx: use devm_clk_get()
Use devm_clk_get() so that the clk_put() happens automatically when
the last reference to this driver is dropped.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Mika Westerberg <mika.westerberg@iki.fi>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/spi-ep93xx.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c index 8d562526abe5..cc2a2405bd1d 100644 --- a/drivers/spi/spi-ep93xx.c +++ b/drivers/spi/spi-ep93xx.c @@ -1016,7 +1016,7 @@ static int ep93xx_spi_probe(struct platform_device *pdev) espi = spi_master_get_devdata(master); - espi->clk = clk_get(&pdev->dev, NULL); + espi->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(espi->clk)) { dev_err(&pdev->dev, "unable to get spi clock\n"); error = PTR_ERR(espi->clk); @@ -1039,14 +1039,14 @@ static int ep93xx_spi_probe(struct platform_device *pdev) espi->regs_base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(espi->regs_base)) { error = PTR_ERR(espi->regs_base); - goto fail_put_clock; + goto fail_release_master; } error = devm_request_irq(&pdev->dev, irq, ep93xx_spi_interrupt, 0, "ep93xx-spi", espi); if (error) { dev_err(&pdev->dev, "failed to request irq\n"); - goto fail_put_clock; + goto fail_release_master; } if (info->use_dma && ep93xx_spi_setup_dma(espi)) @@ -1080,8 +1080,6 @@ fail_free_queue: destroy_workqueue(espi->wq); fail_free_dma: ep93xx_spi_release_dma(espi); -fail_put_clock: - clk_put(espi->clk); fail_release_master: spi_master_put(master); @@ -1117,7 +1115,6 @@ static int ep93xx_spi_remove(struct platform_device *pdev) spin_unlock_irq(&espi->lock); ep93xx_spi_release_dma(espi); - clk_put(espi->clk); spi_unregister_master(master); return 0; |