lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <56B63ED2.3000906@kernel.org>
Date:	Sat, 6 Feb 2016 18:43:30 +0000
From:	Jonathan Cameron <jic23@...nel.org>
To:	"Gujulan Elango, Hari Prasath (H.)" <hgujulan@...teon.com>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"dan.carpenter@...cle.com" <dan.carpenter@...cle.com>,
	"mranostay@...il.com" <mranostay@...il.com>,
	"knaack.h@....de" <knaack.h@....de>,
	"lars@...afoo.de" <lars@...afoo.de>
Cc:	"ciorneiioana@...il.com" <ciorneiioana@...il.com>,
	"daniel.baluta@...el.com" <daniel.baluta@...el.com>,
	"hamohammed.sa@...il.com" <hamohammed.sa@...il.com>,
	"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Babu, Viswanathan (V.)" <vbabu3@...teon.com>
Subject: Re: [PATCHv3] staging: iio: replace clk_get() with devm_clk_get()

On 02/02/16 12:56, Gujulan Elango, Hari Prasath (H.) wrote:
> This patch replaces the clk_get() with devm_clk_get().Accordingly,modified
> the error paths,rename error labels and removed clk_put() in probe() &
> remove functions.
> 
> Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@...teon.com>
Applied to the togreg branch of iio.git - initially pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan
> ---
> 	v3: Rename error path labels to suite modified code as reviewd
> 	    by Matt Ranostay.
> 	    Remove clk_put() from the driver remove method as pointed by
> 	    Jonathan Cameron.
> 
> 	v2: From email address was missing as pointed by Dan Carpenter.
> ---
>  drivers/staging/iio/adc/spear_adc.c | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/spear_adc.c b/drivers/staging/iio/adc/spear_adc.c
> index 712cae0..f2c0065 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,28 +297,28 @@ 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);
>  	if (irq <= 0) {
>  		dev_err(dev, "failed getting interrupt resource\n");
>  		ret = -EINVAL;
> -		goto errout3;
> +		goto errout2;
>  	}
>  
>  	ret = devm_request_irq(dev, irq, spear_adc_isr, 0, SPEAR_ADC_MOD_NAME,
>  			       st);
>  	if (ret < 0) {
>  		dev_err(dev, "failed requesting interrupt\n");
> -		goto errout3;
> +		goto errout2;
>  	}
>  
>  	if (of_property_read_u32(np, "sampling-frequency",
>  				 &st->sampling_freq)) {
>  		dev_err(dev, "sampling-frequency missing in DT\n");
>  		ret = -EINVAL;
> -		goto errout3;
> +		goto errout2;
>  	}
>  
>  	/*
> @@ -348,16 +348,14 @@ static int spear_adc_probe(struct platform_device *pdev)
>  
>  	ret = iio_device_register(indio_dev);
>  	if (ret)
> -		goto errout3;
> +		goto errout2;
>  
>  	dev_info(dev, "SPEAR ADC driver loaded, IRQ %d\n", irq);
>  
>  	return 0;
>  
> -errout3:
> -	clk_disable_unprepare(st->clk);
>  errout2:
> -	clk_put(st->clk);
> +	clk_disable_unprepare(st->clk);
>  errout1:
>  	iounmap(st->adc_base_spear6xx);
>  	return ret;
> @@ -370,7 +368,6 @@ static int spear_adc_remove(struct platform_device *pdev)
>  
>  	iio_device_unregister(indio_dev);
>  	clk_disable_unprepare(st->clk);
> -	clk_put(st->clk);
>  	iounmap(st->adc_base_spear6xx);
>  
>  	return 0;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ