[PATCH 3/3] ASoC: simple-card: remove platform data style

Kuninori Morimoto <[email protected]>
Newsgroups gmane.linux.sound,gmane.linux.ports.sh.devel
Message-ID <[email protected]>
Simple-Card has created for "platform data" style first, and expanded
to "DT style". Current Simple-Card "platform data" style should not
work during almost 10 years, but no one reported it.

No one is using "platform data" style. Let's remove its support.

Signed-off-by: Kuninori Morimoto <[email protected]>
---
 include/sound/simple_card.h     | 26 --------------
 sound/soc/generic/simple-card.c | 61 ++++-----------------------------
 2 files changed, 6 insertions(+), 81 deletions(-)
 delete mode 100644 include/sound/simple_card.h

diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h
deleted file mode 100644
index 2e999916dbd7d..0000000000000
--- a/include/sound/simple_card.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
- * ASoC simple sound card support
- *
- * Copyright (C) 2012 Renesas Solutions Corp.
- * Kuninori Morimoto <[email protected]>
- */
-
-#ifndef __SIMPLE_CARD_H
-#define __SIMPLE_CARD_H
-
-#include <sound/soc.h>
-#include <sound/simple_card_utils.h>
-
-struct simple_util_info {
-	const char *name;
-	const char *card;
-	const char *codec;
-	const char *platform;
-
-	unsigned int daifmt;
-	struct simple_util_dai cpu_dai;
-	struct simple_util_dai codec_dai;
-};
-
-#endif /* __SIMPLE_CARD_H */
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index b24ba1330896c..b4957e0252113 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -13,9 +13,9 @@
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/string.h>
-#include <sound/simple_card.h>
-#include <sound/soc-dai.h>
+#include <sound/simple_card_utils.h>
 #include <sound/soc.h>
+#include <sound/soc-dai.h>
 
 #define DPCM_SELECTABLE 1
 
@@ -708,7 +708,6 @@ static int simple_probe(struct platform_device *pdev)
 {
 	struct simple_util_priv *priv;
 	struct device *dev = &pdev->dev;
-	struct device_node *np = dev->of_node;
 	struct snd_soc_card *card;
 	int ret;
 
@@ -740,58 +739,10 @@ static int simple_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto end;
 
-	if (np && of_device_is_available(np)) {
-
-		ret = simple_parse_of(priv, li);
-		if (ret < 0) {
-			dev_err_probe(dev, ret, "parse error\n");
-			goto err;
-		}
-
-	} else {
-		struct simple_util_info *cinfo;
-		struct snd_soc_dai_link_component *cpus;
-		struct snd_soc_dai_link_component *codecs;
-		struct snd_soc_dai_link_component *platform;
-		struct snd_soc_dai_link *dai_link = priv->dai_link;
-		struct simple_dai_props *dai_props = priv->dai_props;
-
-		ret = -EINVAL;
-
-		cinfo = dev->platform_data;
-		if (!cinfo) {
-			dev_err(dev, "no info for asoc-simple-card\n");
-			goto err;
-		}
-
-		if (!cinfo->name ||
-		    !cinfo->codec_dai.name ||
-		    !cinfo->codec ||
-		    !cinfo->platform ||
-		    !cinfo->cpu_dai.name) {
-			dev_err(dev, "insufficient simple_util_info settings\n");
-			goto err;
-		}
-
-		cpus			= dai_link->cpus;
-		cpus->dai_name		= cinfo->cpu_dai.name;
-
-		codecs			= dai_link->codecs;
-		codecs->name		= cinfo->codec;
-		codecs->dai_name	= cinfo->codec_dai.name;
-
-		platform		= dai_link->platforms;
-		platform->name		= cinfo->platform;
-
-		card->name		= (cinfo->card) ? cinfo->card : cinfo->name;
-		dai_link->name		= cinfo->name;
-		dai_link->stream_name	= cinfo->name;
-		dai_link->dai_fmt	= cinfo->daifmt;
-		dai_link->init		= simple_util_dai_init;
-		memcpy(dai_props->cpu_dai, &cinfo->cpu_dai,
-					sizeof(*dai_props->cpu_dai));
-		memcpy(dai_props->codec_dai, &cinfo->codec_dai,
-					sizeof(*dai_props->codec_dai));
+	ret = simple_parse_of(priv, li);
+	if (ret < 0) {
+		dev_err_probe(dev, ret, "parse error\n");
+		goto err;
 	}
 
 	snd_soc_card_set_drvdata(card, priv);
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.