Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1314023

[PATCH] staging: iio: replace clk_get() with devm_clk_get()

From "Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com>
Newsgroups linux.kernel
Subject [PATCH] staging: iio: replace clk_get() with devm_clk_get()
Date 2016-01-21 10:30 +0100
Message-ID <qTjIZ-3ho-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Hari Prasath Gujulan Elango

This patch replaces the clk_get() with devm_clk_get().
Accordingly,modified the error paths and removed clk_put() as well.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
---
 drivers/staging/iio/adc/spear_adc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/adc/spear_adc.c b/drivers/staging/iio/adc/spear_adc.c
index 712cae0..4ac0f54 100644
--- a/drivers/staging/iio/adc/spear_adc.c
+++ b/drivers/staging/iio/adc/spear_adc.c
@@ -288,7 +288,7 @@ static int spear_adc_probe(struct platform_device *pdev)
 	st->adc_base_spear3xx =
 		(struct adc_regs_spear3xx __iomem *)st->adc_base_spear6xx;
 
-	st->clk = clk_get(dev, NULL);
+	st->clk = devm_clk_get(dev, NULL);
 	if (IS_ERR(st->clk)) {
 		dev_err(dev, "failed getting clock\n");
 		goto errout1;
@@ -297,7 +297,7 @@ static int spear_adc_probe(struct platform_device *pdev)
 	ret = clk_prepare_enable(st->clk);
 	if (ret) {
 		dev_err(dev, "failed enabling clock\n");
-		goto errout2;
+		goto errout1;
 	}
 
 	irq = platform_get_irq(pdev, 0);
@@ -356,8 +356,6 @@ static int spear_adc_probe(struct platform_device *pdev)
 
 errout3:
 	clk_disable_unprepare(st->clk);
-errout2:
-	clk_put(st->clk);
 errout1:
 	iounmap(st->adc_base_spear6xx);
 	return ret;
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] staging: iio: replace clk_get() with devm_clk_get() "Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com> - 2016-01-21 10:30 +0100
  Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get() Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-21 10:50 +0100
    Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get() "Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com> - 2016-01-21 11:00 +0100
  Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get() Matt Ranostay <mranostay@gmail.com> - 2016-01-21 20:30 +0100
    Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get() Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-21 20:50 +0100
    Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get() "Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com> - 2016-01-22 10:10 +0100

csiph-web