* [PATCH] staging: iio: replace clk_get() with devm_clk_get()
@ 2016-01-21 9:11 Gujulan Elango, Hari Prasath (H.)
2016-01-21 9:45 ` Dan Carpenter
2016-01-21 19:21 ` Matt Ranostay
0 siblings, 2 replies; 6+ messages in thread
From: Gujulan Elango, Hari Prasath (H.) @ 2016-01-21 9:11 UTC (permalink / raw)
To: gregkh@linuxfoundation.org, jic23@kernel.org, knaack.h@gmx.de,
lars@metafoo.de, pmeerw@pmeerw.net, daniel.baluta@intel.com,
ciorneiioana@gmail.com, hamohammed.sa@gmail.com
Cc: devel@driverdev.osuosl.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get()
2016-01-21 9:11 [PATCH] staging: iio: replace clk_get() with devm_clk_get() Gujulan Elango, Hari Prasath (H.)
@ 2016-01-21 9:45 ` Dan Carpenter
2016-01-21 9:53 ` Gujulan Elango, Hari Prasath (H.)
2016-01-21 19:21 ` Matt Ranostay
1 sibling, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2016-01-21 9:45 UTC (permalink / raw)
To: Gujulan Elango, Hari Prasath (H.)
Cc: gregkh@linuxfoundation.org, jic23@kernel.org, knaack.h@gmx.de,
lars@metafoo.de, pmeerw@pmeerw.net, daniel.baluta@intel.com,
ciorneiioana@gmail.com, hamohammed.sa@gmail.com,
devel@driverdev.osuosl.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
On Thu, Jan 21, 2016 at 09:11:38AM +0000, Gujulan Elango, Hari Prasath (H.) wrote:
> From: Hari Prasath Gujulan Elango
>
Your email address is missing here.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get()
2016-01-21 9:45 ` Dan Carpenter
@ 2016-01-21 9:53 ` Gujulan Elango, Hari Prasath (H.)
0 siblings, 0 replies; 6+ messages in thread
From: Gujulan Elango, Hari Prasath (H.) @ 2016-01-21 9:53 UTC (permalink / raw)
To: Dan Carpenter
Cc: gregkh@linuxfoundation.org, jic23@kernel.org, knaack.h@gmx.de,
lars@metafoo.de, pmeerw@pmeerw.net, daniel.baluta@intel.com,
ciorneiioana@gmail.com, hamohammed.sa@gmail.com,
devel@driverdev.osuosl.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
On Thu, Jan 21, 2016 at 12:45:59PM +0300, Dan Carpenter wrote:
> On Thu, Jan 21, 2016 at 09:11:38AM +0000, Gujulan Elango, Hari Prasath (H.) wrote:
> > From: Hari Prasath Gujulan Elango
> >
>
> Your email address is missing here.
Hello Dan,
Many thanks for notifying.I am sending a v2.
regards,
Hari Prasath
>
> regards,
> dan carpenter
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get()
2016-01-21 9:11 [PATCH] staging: iio: replace clk_get() with devm_clk_get() Gujulan Elango, Hari Prasath (H.)
2016-01-21 9:45 ` Dan Carpenter
@ 2016-01-21 19:21 ` Matt Ranostay
2016-01-21 19:46 ` Dan Carpenter
2016-01-22 7:31 ` Gujulan Elango, Hari Prasath (H.)
1 sibling, 2 replies; 6+ messages in thread
From: Matt Ranostay @ 2016-01-21 19:21 UTC (permalink / raw)
To: Gujulan Elango, Hari Prasath (H.)
Cc: gregkh@linuxfoundation.org, jic23@kernel.org, knaack.h@gmx.de,
lars@metafoo.de, pmeerw@pmeerw.net, daniel.baluta@intel.com,
ciorneiioana@gmail.com, hamohammed.sa@gmail.com,
devel@driverdev.osuosl.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
On Thu, Jan 21, 2016 at 1:11 AM, Gujulan Elango, Hari Prasath (H.)
<hgujulan@visteon.com> wrote:
> 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);
Shouldn't errout3 now be errout2.. having a gap would seem odd.
> -errout2:
> - clk_put(st->clk);
> errout1:
> iounmap(st->adc_base_spear6xx);
> return ret;
> --
> 1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get()
2016-01-21 19:21 ` Matt Ranostay
@ 2016-01-21 19:46 ` Dan Carpenter
2016-01-22 7:31 ` Gujulan Elango, Hari Prasath (H.)
1 sibling, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2016-01-21 19:46 UTC (permalink / raw)
To: Matt Ranostay
Cc: Gujulan Elango, Hari Prasath (H.), daniel.baluta@intel.com,
ciorneiioana@gmail.com, lars@metafoo.de, hamohammed.sa@gmail.com,
linux-iio@vger.kernel.org, gregkh@linuxfoundation.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
pmeerw@pmeerw.net, knaack.h@gmx.de, jic23@kernel.org
On Thu, Jan 21, 2016 at 11:21:53AM -0800, Matt Ranostay wrote:
> > @@ -356,8 +356,6 @@ static int spear_adc_probe(struct platform_device *pdev)
> >
> > errout3:
> > clk_disable_unprepare(st->clk);
>
> Shouldn't errout3 now be errout2.. having a gap would seem odd.
>
> > -errout2:
> > - clk_put(st->clk);
> > errout1:
> > iounmap(st->adc_base_spear6xx);
GW-BASIC style numbered gotos are nonsense. Label names should be name
after what the label does.
err_unprepare:
err_put:
err_iounmap:
But that's something for a different patch, not related to this patch.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get()
2016-01-21 19:21 ` Matt Ranostay
2016-01-21 19:46 ` Dan Carpenter
@ 2016-01-22 7:31 ` Gujulan Elango, Hari Prasath (H.)
1 sibling, 0 replies; 6+ messages in thread
From: Gujulan Elango, Hari Prasath (H.) @ 2016-01-22 7:31 UTC (permalink / raw)
To: Matt Ranostay
Cc: gregkh@linuxfoundation.org, jic23@kernel.org, knaack.h@gmx.de,
lars@metafoo.de, pmeerw@pmeerw.net, daniel.baluta@intel.com,
ciorneiioana@gmail.com, hamohammed.sa@gmail.com,
devel@driverdev.osuosl.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
On Thu, Jan 21, 2016 at 11:21:53AM -0800, Matt Ranostay wrote:
> On Thu, Jan 21, 2016 at 1:11 AM, Gujulan Elango, Hari Prasath (H.)
> <hgujulan@visteon.com> wrote:
> > 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);
>
> Shouldn't errout3 now be errout2.. having a gap would seem odd.
>
I agree with you on this. But as Dan says,I would correct it in a
different patch.
> > -errout2:
> > - clk_put(st->clk);
> > errout1:
> > iounmap(st->adc_base_spear6xx);
> > return ret;
> > --
> > 1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-01-22 9:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-21 9:11 [PATCH] staging: iio: replace clk_get() with devm_clk_get() Gujulan Elango, Hari Prasath (H.)
2016-01-21 9:45 ` Dan Carpenter
2016-01-21 9:53 ` Gujulan Elango, Hari Prasath (H.)
2016-01-21 19:21 ` Matt Ranostay
2016-01-21 19:46 ` Dan Carpenter
2016-01-22 7:31 ` Gujulan Elango, Hari Prasath (H.)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox