linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"knaack.h@gmx.de" <knaack.h@gmx.de>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"pmeerw@pmeerw.net" <pmeerw@pmeerw.net>,
	"daniel.baluta@intel.com" <daniel.baluta@intel.com>,
	"ciorneiioana@gmail.com" <ciorneiioana@gmail.com>,
	"hamohammed.sa@gmail.com" <hamohammed.sa@gmail.com>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Stefan Roese <sr@denx.de>
Subject: Re: [PATCHv2] staging: iio: replace clk_get() with devm_clk_get()
Date: Sun, 24 Jan 2016 16:05:07 +0000	[thread overview]
Message-ID: <56A4F633.1030008@kernel.org> (raw)
In-Reply-To: <20160121095653.GA10394@IND12F0122>

On 21/01/16 09:55, Gujulan Elango, Hari Prasath (H.) wrote:
> From: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
> 
> 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>
What about the clk_put in the remove function?
Drop that one as well as the managed handling will deal with that
anyway.

Also, I'd be happier if you reorganised the probe to do the clk stuff
before the of_iomap.  That way it makes it readily apparent that we
haven't introduced a different in probe / remove (reversed) operations.

I'd largely forgotten about this driver after doing a cleanup set
back in 2014.  Hartmut, you raised a few points back then about
some disagreements between the driver and the datasheet, otherwise
I'd probably have just shifted it out of staging back then.

Stefan has been quiet on this one for a while, I don't suppose anyone
actually has one of these to test?  I was always nervous about making
the other changes Hartmut suggested without someone testing them.

Hari, are you doing this as generic cleanup (always good to have!) or
because you are working with the hardware and hence looking at the code?

Jonathan


> ---
> 	v2: email address was missing in the From field.
> ---
>  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;
> 

      reply	other threads:[~2016-01-24 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21  9:55 [PATCHv2] staging: iio: replace clk_get() with devm_clk_get() Gujulan Elango, Hari Prasath (H.)
2016-01-24 16:05 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56A4F633.1030008@kernel.org \
    --to=jic23@kernel.org \
    --cc=ciorneiioana@gmail.com \
    --cc=daniel.baluta@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=hgujulan@visteon.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=sr@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).