Skip to contentSkip to conversation

crypto: s5p-sss - Use devm_clk_get()

PATCH Superseded Jingoo Han 1 participant 1 message Jan 9, 2013

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 crypto: s5p-sss - Use devm_clk_get()

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

---
 drivers/crypto/s5p-sss.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/crypto/s5p-sss.c +1 -3
index 49ad8cb..4b31432 100644
@@ -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);
Signature · 1 line
1.7.2.5