linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: omap-dmic: Use devm_clk_get
@ 2014-07-11  4:14 Himangi Saraogi
  2014-07-14  5:40 ` Peter Ujfalusi
  2014-07-14 18:02 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Himangi Saraogi @ 2014-07-11  4:14 UTC (permalink / raw)
  To: Peter Ujfalusi, Jarkko Nikula, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, linux-omap, alsa-devel,
	linux-kernel
  Cc: julia.lawall

This patch introduces the use of managed interfaces like devm_clk_get
and does away with the clk_puts in the probe and remove functions. A
label is also done away with.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
---
This is a follow up to ASoC: omap-dmic: use managed interfaces which
failed to apply as the other devm_ functions were introduced by a patch
ASoC: omap-dmic: Use devm_snd_soc_register_component.

 sound/soc/omap/omap-dmic.c | 29 ++++++-----------------------
 1 file changed, 6 insertions(+), 23 deletions(-)

diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
index f125eb9..0f34e28 100644
--- a/sound/soc/omap/omap-dmic.c
+++ b/sound/soc/omap/omap-dmic.c
@@ -466,7 +466,7 @@ static int asoc_dmic_probe(struct platform_device *pdev)
 
 	mutex_init(&dmic->mutex);
 
-	dmic->fclk = clk_get(dmic->dev, "fck");
+	dmic->fclk = devm_clk_get(dmic->dev, "fck");
 	if (IS_ERR(dmic->fclk)) {
 		dev_err(dmic->dev, "cant get fck\n");
 		return -ENODEV;
@@ -475,8 +475,7 @@ static int asoc_dmic_probe(struct platform_device *pdev)
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma");
 	if (!res) {
 		dev_err(dmic->dev, "invalid dma memory resource\n");
-		ret = -ENODEV;
-		goto err_put_clk;
+		return -ENODEV;
 	}
 	dmic->dma_data.addr = res->start + OMAP_DMIC_DATA_REG;
 
@@ -484,34 +483,19 @@ static int asoc_dmic_probe(struct platform_device *pdev)
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu");
 	dmic->io_base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(dmic->io_base)) {
-		ret = PTR_ERR(dmic->io_base);
-		goto err_put_clk;
-	}
+	if (IS_ERR(dmic->io_base))
+		return PTR_ERR(dmic->io_base);
 
 
 	ret = devm_snd_soc_register_component(&pdev->dev,
 					      &omap_dmic_component,
 					      &omap_dmic_dai, 1);
 	if (ret)
-		goto err_put_clk;
+		return ret;
 
 	ret = omap_pcm_platform_register(&pdev->dev);
 	if (ret)
-		goto err_put_clk;
-
-	return 0;
-
-err_put_clk:
-	clk_put(dmic->fclk);
-	return ret;
-}
-
-static int asoc_dmic_remove(struct platform_device *pdev)
-{
-	struct omap_dmic *dmic = platform_get_drvdata(pdev);
-
-	clk_put(dmic->fclk);
+		return ret;
 
 	return 0;
 }
@@ -529,7 +513,6 @@ static struct platform_driver asoc_dmic_driver = {
 		.of_match_table = omap_dmic_of_match,
 	},
 	.probe = asoc_dmic_probe,
-	.remove = asoc_dmic_remove,
 };
 
 module_platform_driver(asoc_dmic_driver);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: omap-dmic: Use devm_clk_get
  2014-07-11  4:14 [PATCH] ASoC: omap-dmic: Use devm_clk_get Himangi Saraogi
@ 2014-07-14  5:40 ` Peter Ujfalusi
  2014-07-14 18:02 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Ujfalusi @ 2014-07-14  5:40 UTC (permalink / raw)
  To: Himangi Saraogi, Jarkko Nikula, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, linux-omap, alsa-devel,
	linux-kernel
  Cc: julia.lawall

On 07/11/2014 07:14 AM, Himangi Saraogi wrote:
> This patch introduces the use of managed interfaces like devm_clk_get
> and does away with the clk_puts in the probe and remove functions. A
> label is also done away with.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> 
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
> ---
> This is a follow up to ASoC: omap-dmic: use managed interfaces which
> failed to apply as the other devm_ functions were introduced by a patch
> ASoC: omap-dmic: Use devm_snd_soc_register_component.
> 
>  sound/soc/omap/omap-dmic.c | 29 ++++++-----------------------
>  1 file changed, 6 insertions(+), 23 deletions(-)
> 
> diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
> index f125eb9..0f34e28 100644
> --- a/sound/soc/omap/omap-dmic.c
> +++ b/sound/soc/omap/omap-dmic.c
> @@ -466,7 +466,7 @@ static int asoc_dmic_probe(struct platform_device *pdev)
>  
>  	mutex_init(&dmic->mutex);
>  
> -	dmic->fclk = clk_get(dmic->dev, "fck");
> +	dmic->fclk = devm_clk_get(dmic->dev, "fck");
>  	if (IS_ERR(dmic->fclk)) {
>  		dev_err(dmic->dev, "cant get fck\n");
>  		return -ENODEV;
> @@ -475,8 +475,7 @@ static int asoc_dmic_probe(struct platform_device *pdev)
>  	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma");
>  	if (!res) {
>  		dev_err(dmic->dev, "invalid dma memory resource\n");
> -		ret = -ENODEV;
> -		goto err_put_clk;
> +		return -ENODEV;
>  	}
>  	dmic->dma_data.addr = res->start + OMAP_DMIC_DATA_REG;
>  
> @@ -484,34 +483,19 @@ static int asoc_dmic_probe(struct platform_device *pdev)
>  
>  	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu");
>  	dmic->io_base = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(dmic->io_base)) {
> -		ret = PTR_ERR(dmic->io_base);
> -		goto err_put_clk;
> -	}
> +	if (IS_ERR(dmic->io_base))
> +		return PTR_ERR(dmic->io_base);
>  
>  
>  	ret = devm_snd_soc_register_component(&pdev->dev,
>  					      &omap_dmic_component,
>  					      &omap_dmic_dai, 1);
>  	if (ret)
> -		goto err_put_clk;
> +		return ret;
>  
>  	ret = omap_pcm_platform_register(&pdev->dev);
>  	if (ret)
> -		goto err_put_clk;
> -
> -	return 0;
> -
> -err_put_clk:
> -	clk_put(dmic->fclk);
> -	return ret;
> -}
> -
> -static int asoc_dmic_remove(struct platform_device *pdev)
> -{
> -	struct omap_dmic *dmic = platform_get_drvdata(pdev);
> -
> -	clk_put(dmic->fclk);
> +		return ret;
>  
>  	return 0;
>  }
> @@ -529,7 +513,6 @@ static struct platform_driver asoc_dmic_driver = {
>  		.of_match_table = omap_dmic_of_match,
>  	},
>  	.probe = asoc_dmic_probe,
> -	.remove = asoc_dmic_remove,
>  };
>  
>  module_platform_driver(asoc_dmic_driver);
> 


-- 
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: omap-dmic: Use devm_clk_get
  2014-07-11  4:14 [PATCH] ASoC: omap-dmic: Use devm_clk_get Himangi Saraogi
  2014-07-14  5:40 ` Peter Ujfalusi
@ 2014-07-14 18:02 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-07-14 18:02 UTC (permalink / raw)
  To: Himangi Saraogi
  Cc: Peter Ujfalusi, Jarkko Nikula, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, linux-omap, alsa-devel, linux-kernel, julia.lawall

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

On Fri, Jul 11, 2014 at 09:44:06AM +0530, Himangi Saraogi wrote:
> This patch introduces the use of managed interfaces like devm_clk_get
> and does away with the clk_puts in the probe and remove functions. A
> label is also done away with.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-14 18:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11  4:14 [PATCH] ASoC: omap-dmic: Use devm_clk_get Himangi Saraogi
2014-07-14  5:40 ` Peter Ujfalusi
2014-07-14 18:02 ` Mark Brown

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).