diff mbox

[3/5] ASoC: samsung: Use snd_soc_of_put_dai_link_codecs() in odroid.c

Message ID 20180314164115.22736-3-s.nawrocki@samsung.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Now when a helper for unreferencing device nodes is available
we can get rid of the local implementation.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 sound/soc/samsung/odroid.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

Comments

Krzysztof Kozlowski March 16, 2018, 7:33 a.m. UTC | #1
On Wed, Mar 14, 2018 at 5:41 PM, Sylwester Nawrocki
<s.nawrocki@samsung.com> wrote:
> Now when a helper for unreferencing device nodes is available
> we can get rid of the local implementation.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
>  sound/soc/samsung/odroid.c | 16 ++--------------
>  1 file changed, 2 insertions(+), 14 deletions(-)

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c
index e1b59457a327..e7b371b07230 100644
--- a/sound/soc/samsung/odroid.c
+++ b/sound/soc/samsung/odroid.c
@@ -91,18 +91,6 @@  static const struct snd_soc_ops odroid_card_ops = {
 	.hw_params = odroid_card_hw_params,
 };
 
-static void odroid_put_codec_of_nodes(struct snd_soc_dai_link *link)
-{
-	struct snd_soc_dai_link_component *component = link->codecs;
-	int i;
-
-	for (i = 0; i < link->num_codecs; i++, component++) {
-		if (!component->of_node)
-			break;
-		of_node_put(component->of_node);
-	}
-}
-
 static int odroid_audio_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -197,7 +185,7 @@  static int odroid_audio_probe(struct platform_device *pdev)
 err_put_i2s_n:
 	of_node_put(link->cpu_of_node);
 err_put_codec_n:
-	odroid_put_codec_of_nodes(link);
+	snd_soc_of_put_dai_link_codecs(link);
 	return ret;
 }
 
@@ -206,7 +194,7 @@  static int odroid_audio_remove(struct platform_device *pdev)
 	struct odroid_priv *priv = platform_get_drvdata(pdev);
 
 	of_node_put(priv->dai_link.cpu_of_node);
-	odroid_put_codec_of_nodes(&priv->dai_link);
+	snd_soc_of_put_dai_link_codecs(&priv->dai_link);
 	clk_put(priv->sclk_i2s);
 	clk_put(priv->clk_i2s_bus);