The devm_ functions allocate memory that is released when a driver
detaches. This patch uses devm_clk_get() for these functions.
These make the code smaller and a bit simpler

Signed-off-by: Jingoo Han <[email protected]>
---
 drivers/crypto/s5p-sss.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c
index 49ad8cb..4b31432 100644
--- a/drivers/crypto/s5p-sss.c
+++ b/drivers/crypto/s5p-sss.c
@@ -580,7 +580,7 @@ static int s5p_aes_probe(struct platform_device *pdev)
                                     resource_size(res), pdev->name))
                return -EBUSY;
 
-       pdata->clk = clk_get(dev, "secss");
+       pdata->clk = devm_clk_get(dev, "secss");
        if (IS_ERR(pdata->clk)) {
                dev_err(dev, "failed to find secss clock source\n");
                return -ENOENT;
@@ -645,7 +645,6 @@ static int s5p_aes_probe(struct platform_device *pdev)
 
  err_irq:
        clk_disable(pdata->clk);
-       clk_put(pdata->clk);
 
        s5p_dev = NULL;
        platform_set_drvdata(pdev, NULL);
@@ -667,7 +666,6 @@ static int s5p_aes_remove(struct platform_device *pdev)
        tasklet_kill(&pdata->tasklet);
 
        clk_disable(pdata->clk);
-       clk_put(pdata->clk);
 
        s5p_dev = NULL;
        platform_set_drvdata(pdev, NULL);
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to