Commit 18e34d56 authored by Jingoo Han's avatar Jingoo Han Committed by Mark Brown

spi: txx9: Use devm_clk_get()

Use devm_clk_get() to make cleanup paths simpler.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 6ce4eac1
...@@ -348,7 +348,7 @@ static int txx9spi_probe(struct platform_device *dev) ...@@ -348,7 +348,7 @@ static int txx9spi_probe(struct platform_device *dev)
INIT_LIST_HEAD(&c->queue); INIT_LIST_HEAD(&c->queue);
init_waitqueue_head(&c->waitq); 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)) { if (IS_ERR(c->clk)) {
ret = PTR_ERR(c->clk); ret = PTR_ERR(c->clk);
c->clk = NULL; c->clk = NULL;
...@@ -415,10 +415,8 @@ static int txx9spi_probe(struct platform_device *dev) ...@@ -415,10 +415,8 @@ static int txx9spi_probe(struct platform_device *dev)
exit: exit:
if (c->workqueue) if (c->workqueue)
destroy_workqueue(c->workqueue); destroy_workqueue(c->workqueue);
if (c->clk) { if (c->clk)
clk_disable(c->clk); clk_disable(c->clk);
clk_put(c->clk);
}
spi_master_put(master); spi_master_put(master);
return ret; return ret;
} }
...@@ -430,7 +428,6 @@ static int txx9spi_remove(struct platform_device *dev) ...@@ -430,7 +428,6 @@ static int txx9spi_remove(struct platform_device *dev)
destroy_workqueue(c->workqueue); destroy_workqueue(c->workqueue);
clk_disable(c->clk); clk_disable(c->clk);
clk_put(c->clk);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment