summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-12-09 19:23:12 +0900
committerMark Brown <broonie@linaro.org>2013-12-17 22:56:24 +0000
commit18e34d568efa5f1f8b75a76400dbd06c7811c73b (patch)
tree85c20e8f8273b3fce3d47b2dbb6b5ab5f34fd40d /drivers
parent6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff)
downloadlinux-18e34d568efa5f1f8b75a76400dbd06c7811c73b.tar.bz2
spi: txx9: Use devm_clk_get()
Use devm_clk_get() to make cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/spi-txx9.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c
index 637cce2b8bdd..b206de1616d5 100644
--- a/drivers/spi/spi-txx9.c
+++ b/drivers/spi/spi-txx9.c
@@ -348,7 +348,7 @@ static int txx9spi_probe(struct platform_device *dev)
INIT_LIST_HEAD(&c->queue);
init_waitqueue_head(&c->waitq);
- c->clk = clk_get(&dev->dev, "spi-baseclk");
+ c->clk = devm_clk_get(&dev->dev, "spi-baseclk");
if (IS_ERR(c->clk)) {
ret = PTR_ERR(c->clk);
c->clk = NULL;
@@ -415,10 +415,8 @@ exit_busy:
exit:
if (c->workqueue)
destroy_workqueue(c->workqueue);
- if (c->clk) {
+ if (c->clk)
clk_disable(c->clk);
- clk_put(c->clk);
- }
spi_master_put(master);
return ret;
}
@@ -430,7 +428,6 @@ static int txx9spi_remove(struct platform_device *dev)
destroy_workqueue(c->workqueue);
clk_disable(c->clk);
- clk_put(c->clk);
return 0;
}