ASoC: samsung: Use devm_snd_soc_register_platform
authorTushar Behera <tushar.behera@linaro.org>
Wed, 21 May 2014 03:22:18 +0000 (08:52 +0530)
committerMark Brown <broonie@linaro.org>
Wed, 21 May 2014 23:20:11 +0000 (00:20 +0100)
Replaced snd_soc_register_platform with devm_snd_soc_register_platform
in samsung_asoc_dma_platform_register(). This makes the function
samsung_asoc_dma_platform_unregister() redundant. This is removed and
all its users are updated.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/samsung/ac97.c
sound/soc/samsung/dma.c
sound/soc/samsung/dma.h
sound/soc/samsung/dmaengine.c
sound/soc/samsung/i2s.c
sound/soc/samsung/idma.c
sound/soc/samsung/pcm.c
sound/soc/samsung/s3c2412-i2s.c
sound/soc/samsung/s3c24xx-i2s.c
sound/soc/samsung/spdif.c

index 76b072bd4ba25eb9ba926d56cefc3702c45e5a17..fbce03bbdb2b5d6af1d6b93ac34063c513e5834c 100644 (file)
@@ -461,7 +461,6 @@ static int s3c_ac97_remove(struct platform_device *pdev)
 {
        struct resource *irq_res;
 
-       samsung_asoc_dma_platform_unregister(&pdev->dev);
        snd_soc_unregister_component(&pdev->dev);
 
        irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
index dc09b71b7d9f766398a94592a1657f7cdbe5667a..d9dc7bcc03362d4ccd6f9836b6b344271dc291e1 100644 (file)
@@ -445,16 +445,10 @@ EXPORT_SYMBOL_GPL(samsung_asoc_init_dma_data);
 
 int samsung_asoc_dma_platform_register(struct device *dev)
 {
-       return snd_soc_register_platform(dev, &samsung_asoc_platform);
+       return devm_snd_soc_register_platform(dev, &samsung_asoc_platform);
 }
 EXPORT_SYMBOL_GPL(samsung_asoc_dma_platform_register);
 
-void samsung_asoc_dma_platform_unregister(struct device *dev)
-{
-       snd_soc_unregister_platform(dev);
-}
-EXPORT_SYMBOL_GPL(samsung_asoc_dma_platform_unregister);
-
 MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");
 MODULE_DESCRIPTION("Samsung ASoC DMA Driver");
 MODULE_LICENSE("GPL");
index ad7c0f04f00d59529163e292146b3c6641d391d7..070ab0f096092c22c6fd47ec239b89531a7a3a52 100644 (file)
@@ -33,6 +33,5 @@ void samsung_asoc_init_dma_data(struct snd_soc_dai *dai,
                                struct s3c_dma_params *playback,
                                struct s3c_dma_params *capture);
 int samsung_asoc_dma_platform_register(struct device *dev);
-void samsung_asoc_dma_platform_unregister(struct device *dev);
 
 #endif
index 750ce5808d9f31472c7a59e70c25bc637c658857..a0e4e794890978255a00574930b8cb8a920d64d7 100644 (file)
@@ -66,18 +66,13 @@ EXPORT_SYMBOL_GPL(samsung_asoc_init_dma_data);
 
 int samsung_asoc_dma_platform_register(struct device *dev)
 {
-       return snd_dmaengine_pcm_register(dev, &samsung_dmaengine_pcm_config,
-                                         SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME |
-                                         SND_DMAENGINE_PCM_FLAG_COMPAT);
+       return devm_snd_dmaengine_pcm_register(dev,
+                       &samsung_dmaengine_pcm_config,
+                       SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME |
+                       SND_DMAENGINE_PCM_FLAG_COMPAT);
 }
 EXPORT_SYMBOL_GPL(samsung_asoc_dma_platform_register);
 
-void samsung_asoc_dma_platform_unregister(struct device *dev)
-{
-       return snd_dmaengine_pcm_unregister(dev);
-}
-EXPORT_SYMBOL_GPL(samsung_asoc_dma_platform_unregister);
-
 MODULE_AUTHOR("Mark Brown <broonie@linaro.org>");
 MODULE_DESCRIPTION("Samsung dmaengine ASoC driver");
 MODULE_LICENSE("GPL");
index 1e99071fb624cfa6a86418ef22b2181481257473..07ff3e7cb890c59112cf67bc0be1443ac3e05efa 100644 (file)
@@ -1295,8 +1295,6 @@ static int samsung_i2s_remove(struct platform_device *pdev)
        i2s->pri_dai = NULL;
        i2s->sec_dai = NULL;
 
-       samsung_asoc_dma_platform_unregister(&pdev->dev);
-
        return 0;
 }
 
index e9891b44f0e2122514f076913bf35d82bfdb1ccb..8cc5770abb39bec29ea56c3be7131e2bb1e11e15 100644 (file)
@@ -413,13 +413,7 @@ static int asoc_idma_platform_probe(struct platform_device *pdev)
        if (idma_irq < 0)
                return idma_irq;
 
-       return snd_soc_register_platform(&pdev->dev, &asoc_idma_platform);
-}
-
-static int asoc_idma_platform_remove(struct platform_device *pdev)
-{
-       snd_soc_unregister_platform(&pdev->dev);
-       return 0;
+       return devm_snd_soc_register_platform(&pdev->dev, &asoc_idma_platform);
 }
 
 static struct platform_driver asoc_idma_driver = {
@@ -429,7 +423,6 @@ static struct platform_driver asoc_idma_driver = {
        },
 
        .probe = asoc_idma_platform_probe,
-       .remove = asoc_idma_platform_remove,
 };
 
 module_platform_driver(asoc_idma_driver);
index ab54e297957c105ee60e050a259323b453738fff..38df2a86bd5fbc365ed20e6cddb8b655911a47d3 100644 (file)
@@ -624,7 +624,6 @@ static int s3c_pcm_dev_remove(struct platform_device *pdev)
        struct s3c_pcm_info *pcm = &s3c_pcm[pdev->id];
        struct resource *mem_res;
 
-       samsung_asoc_dma_platform_unregister(&pdev->dev);
        snd_soc_unregister_component(&pdev->dev);
 
        pm_runtime_disable(&pdev->dev);
index e9bb5d7a71ee5409ad6c92419d1f8010201a132b..f42da8df3e3ca757314488e312e4f3570574853d 100644 (file)
@@ -192,7 +192,6 @@ err:
 
 static int s3c2412_iis_dev_remove(struct platform_device *pdev)
 {
-       samsung_asoc_dma_platform_unregister(&pdev->dev);
        snd_soc_unregister_component(&pdev->dev);
        return 0;
 }
index d7b8457b565046692db8ad1e25b9376ae412d4b9..8380443b1b39209a0f83f1fc1548dd06005b1f18 100644 (file)
@@ -496,7 +496,6 @@ err:
 
 static int s3c24xx_iis_dev_remove(struct platform_device *pdev)
 {
-       samsung_asoc_dma_platform_unregister(&pdev->dev);
        snd_soc_unregister_component(&pdev->dev);
        return 0;
 }
index cfe63b7bcc9f6b9a6779b9a88db93612b9e6a420..7d89d016fa4945d73548c104c6b5617840feaeb6 100644 (file)
@@ -467,7 +467,6 @@ static int spdif_remove(struct platform_device *pdev)
        struct samsung_spdif_info *spdif = &spdif_info;
        struct resource *mem_res;
 
-       samsung_asoc_dma_platform_unregister(&pdev->dev);
        snd_soc_unregister_component(&pdev->dev);
 
        iounmap(spdif->regs);