[PATCH 1/2] ASoC: simple-card: remove platform data style support

Kuninori Morimoto <[email protected]> Mon, 1 Jun 2026 04:50:13 +0000
Newsgroups org.kernel.vger.linux-sh,org.kernel.vger.linux-sound
Message-ID <[email protected]>
Simple-Card has created for "platform data style" first, and expanded
to "DT style".

SuperH Ecovec24/7724se are the last user of "platform data style"
Current Simple-Card "platform data style" should not work during almost 10
years, but no one reported it.

SuperH is planning to switch to "DT style", "platform data style" is no
longer working, and it seems there is no user. Let's remove "platform
data style", because keeping compatibility is difficult.

Because Ecovec24/7724se are still including <sound/simple_card.h>, this
patch keeps it as-is for now, but it will be removed if SuperH switches
to "DT style".

Signed-off-by: Kuninori Morimoto <[email protected]>
---
 sound/soc/generic/simple-card.c | 61 ++++-----------------------------
 1 file changed, 6 insertions(+), 55 deletions(-)

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