[-next] ASoC: omap-abe-twl6040: Use devm_snd_soc_register_card()
diff mbox

Message ID 1471993817-10903-1-git-send-email-weiyj.lk@gmail.com
State New
Headers show

Commit Message

Wei Yongjun Aug. 23, 2016, 11:10 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

Using devm_snd_soc_register_card() can make the code
shorter and cleaner.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 sound/soc/omap/omap-abe-twl6040.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)




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

Comments

Peter Ujfalusi Aug. 24, 2016, 7:01 a.m. UTC | #1
On 08/24/16 02:10, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Using devm_snd_soc_register_card() can make the code
> shorter and cleaner.

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

> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  sound/soc/omap/omap-abe-twl6040.c | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
> index f61b3b5..89fe95e 100644
> --- a/sound/soc/omap/omap-abe-twl6040.c
> +++ b/sound/soc/omap/omap-abe-twl6040.c
> @@ -305,23 +305,14 @@ static int omap_abe_probe(struct platform_device *pdev)
>  
>  	snd_soc_card_set_drvdata(card, priv);
>  
> -	ret = snd_soc_register_card(card);
> +	ret = devm_snd_soc_register_card(&pdev->dev, card);
>  	if (ret)
> -		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
> +		dev_err(&pdev->dev, "devm_snd_soc_register_card() failed: %d\n",
>  			ret);
>  
>  	return ret;
>  }
>  
> -static int omap_abe_remove(struct platform_device *pdev)
> -{
> -	struct snd_soc_card *card = platform_get_drvdata(pdev);
> -
> -	snd_soc_unregister_card(card);
> -
> -	return 0;
> -}
> -
>  static const struct of_device_id omap_abe_of_match[] = {
>  	{.compatible = "ti,abe-twl6040", },
>  	{ },
> @@ -335,7 +326,6 @@ static struct platform_driver omap_abe_driver = {
>  		.of_match_table = omap_abe_of_match,
>  	},
>  	.probe = omap_abe_probe,
> -	.remove = omap_abe_remove,
>  };
>  
>  static int __init omap_abe_init(void)
> 
> 
>

Patch
diff mbox

diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index f61b3b5..89fe95e 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -305,23 +305,14 @@  static int omap_abe_probe(struct platform_device *pdev)
 
 	snd_soc_card_set_drvdata(card, priv);
 
-	ret = snd_soc_register_card(card);
+	ret = devm_snd_soc_register_card(&pdev->dev, card);
 	if (ret)
-		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
+		dev_err(&pdev->dev, "devm_snd_soc_register_card() failed: %d\n",
 			ret);
 
 	return ret;
 }
 
-static int omap_abe_remove(struct platform_device *pdev)
-{
-	struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-	snd_soc_unregister_card(card);
-
-	return 0;
-}
-
 static const struct of_device_id omap_abe_of_match[] = {
 	{.compatible = "ti,abe-twl6040", },
 	{ },
@@ -335,7 +326,6 @@  static struct platform_driver omap_abe_driver = {
 		.of_match_table = omap_abe_of_match,
 	},
 	.probe = omap_abe_probe,
-	.remove = omap_abe_remove,
 };
 
 static int __init omap_abe_init(void)