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


Groups > linux.kernel > #1207998 > unrolled thread

[PATCH] ASoC: davinci-vcif: Use devm_snd_soc_register_component

Started byVaishali Thakkar <vthakkar1994@gmail.com>
First post2015-08-15 04:40 +0200
Last post2015-08-17 09:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ASoC: davinci-vcif: Use devm_snd_soc_register_component Vaishali Thakkar <vthakkar1994@gmail.com> - 2015-08-15 04:40 +0200
    Re: [PATCH] ASoC: davinci-vcif: Use devm_snd_soc_register_component Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-08-17 09:40 +0200

#1207998 — [PATCH] ASoC: davinci-vcif: Use devm_snd_soc_register_component

FromVaishali Thakkar <vthakkar1994@gmail.com>
Date2015-08-15 04:40 +0200
Subject[PATCH] ASoC: davinci-vcif: Use devm_snd_soc_register_component
Message-ID<pXzy1-4ke-3@gated-at.bofh.it>
Use resource managed function devm_snd_soc_register_component for
component registration instead of snd_soc_register_component.

Also, remove davinci_vcif_remove as it is now redundant.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
---
 sound/soc/davinci/davinci-vcif.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c
index fabd05f..c77d921 100644
--- a/sound/soc/davinci/davinci-vcif.c
+++ b/sound/soc/davinci/davinci-vcif.c
@@ -231,8 +231,9 @@ static int davinci_vcif_probe(struct platform_device *pdev)
 
 	dev_set_drvdata(&pdev->dev, davinci_vcif_dev);
 
-	ret = snd_soc_register_component(&pdev->dev, &davinci_vcif_component,
-					 &davinci_vcif_dai, 1);
+	ret = devm_snd_soc_register_component(&pdev->dev,
+					      &davinci_vcif_component,
+					      &davinci_vcif_dai, 1);
 	if (ret != 0) {
 		dev_err(&pdev->dev, "could not register dai\n");
 		return ret;
@@ -241,23 +242,14 @@ static int davinci_vcif_probe(struct platform_device *pdev)
 	ret = edma_pcm_platform_register(&pdev->dev);
 	if (ret) {
 		dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
-		snd_soc_unregister_component(&pdev->dev);
 		return ret;
 	}
 
 	return 0;
 }
 
-static int davinci_vcif_remove(struct platform_device *pdev)
-{
-	snd_soc_unregister_component(&pdev->dev);
-
-	return 0;
-}
-
 static struct platform_driver davinci_vcif_driver = {
 	.probe		= davinci_vcif_probe,
-	.remove		= davinci_vcif_remove,
 	.driver		= {
 		.name	= "davinci-vcif",
 	},
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1208431

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2015-08-17 09:40 +0200
Message-ID<pYnbs-EP-7@gated-at.bofh.it>
In reply to#1207998
On 08/15/2015 05:31 AM, Vaishali Thakkar wrote:
> Use resource managed function devm_snd_soc_register_component for
> component registration instead of snd_soc_register_component.
> 
> Also, remove davinci_vcif_remove as it is now redundant.

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

> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
> ---
>  sound/soc/davinci/davinci-vcif.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c
> index fabd05f..c77d921 100644
> --- a/sound/soc/davinci/davinci-vcif.c
> +++ b/sound/soc/davinci/davinci-vcif.c
> @@ -231,8 +231,9 @@ static int davinci_vcif_probe(struct platform_device *pdev)
>  
>  	dev_set_drvdata(&pdev->dev, davinci_vcif_dev);
>  
> -	ret = snd_soc_register_component(&pdev->dev, &davinci_vcif_component,
> -					 &davinci_vcif_dai, 1);
> +	ret = devm_snd_soc_register_component(&pdev->dev,
> +					      &davinci_vcif_component,
> +					      &davinci_vcif_dai, 1);
>  	if (ret != 0) {
>  		dev_err(&pdev->dev, "could not register dai\n");
>  		return ret;
> @@ -241,23 +242,14 @@ static int davinci_vcif_probe(struct platform_device *pdev)
>  	ret = edma_pcm_platform_register(&pdev->dev);
>  	if (ret) {
>  		dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
> -		snd_soc_unregister_component(&pdev->dev);
>  		return ret;
>  	}
>  
>  	return 0;
>  }
>  
> -static int davinci_vcif_remove(struct platform_device *pdev)
> -{
> -	snd_soc_unregister_component(&pdev->dev);
> -
> -	return 0;
> -}
> -
>  static struct platform_driver davinci_vcif_driver = {
>  	.probe		= davinci_vcif_probe,
> -	.remove		= davinci_vcif_remove,
>  	.driver		= {
>  		.name	= "davinci-vcif",
>  	},
> 


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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web