diff mbox series

[16/23] ASoC: intel: sof_sdw: Remove redundant parameters in dai creation

Message ID 20230731214257.444605-17-pierre-louis.bossart@linux.intel.com
State New
Headers show
Series ASoC: Intel: machine driver updates for 6.6 | expand

Commit Message

Pierre-Louis Bossart July 31, 2023, 9:42 p.m. UTC
From: Charles Keepax <ckeepax@opensource.cirrus.com>

Pull the device and mach struct out of the card rather than explicitly
passing to sof_card_dai_links_create.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_sdw.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index d4f2711b6f26..dc5337ea75da 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -1348,8 +1348,7 @@  static void set_dailink_map(struct snd_soc_dai_link_codec_ch_map *sdw_codec_ch_m
 
 static const char * const type_strings[] = {"SimpleJack", "SmartAmp", "SmartMic"};
 
-static int create_sdw_dailink(struct snd_soc_card *card,
-			      struct device *dev, int *link_index,
+static int create_sdw_dailink(struct snd_soc_card *card, int *link_index,
 			      struct snd_soc_dai_link *dai_links,
 			      int sdw_be_num, int sdw_cpu_dai_num,
 			      struct snd_soc_dai_link_component *cpus,
@@ -1363,6 +1362,7 @@  static int create_sdw_dailink(struct snd_soc_card *card,
 			      int adr_index,
 			      int dai_index)
 {
+	struct device *dev = card->dev;
 	const struct snd_soc_acpi_link_adr *adr_link_next;
 	struct snd_soc_dai_link_component *codecs;
 	struct sof_sdw_codec_info *codec_info;
@@ -1563,10 +1563,10 @@  static int sof_card_codec_conf_alloc(struct device *dev,
 	return 0;
 }
 
-static int sof_card_dai_links_create(struct device *dev,
-				     struct snd_soc_acpi_mach *mach,
-				     struct snd_soc_card *card)
+static int sof_card_dai_links_create(struct snd_soc_card *card)
 {
+	struct device *dev = card->dev;
+	struct snd_soc_acpi_mach *mach = dev_get_platdata(card->dev);
 	int ssp_num, sdw_be_num = 0, hdmi_num = 0, dmic_num;
 	struct mc_private *ctx = snd_soc_card_get_drvdata(card);
 	struct snd_soc_dai_link_component *idisp_components;
@@ -1723,7 +1723,7 @@  static int sof_card_dai_links_create(struct device *dev,
 				return codec_index;
 
 			for (j = 0; j < codec_info_list[codec_index].dai_num ; j++) {
-				ret = create_sdw_dailink(card, dev, &link_index, dai_links,
+				ret = create_sdw_dailink(card, &link_index, dai_links,
 							 sdw_be_num, sdw_cpu_dai_num, cpus,
 							 adr_link, &cpu_id, group_generated,
 							 codec_conf, codec_conf_count,
@@ -1991,7 +1991,7 @@  static int mc_probe(struct platform_device *pdev)
 
 	log_quirks(card->dev);
 
-	ret = sof_card_dai_links_create(card->dev, mach, card);
+	ret = sof_card_dai_links_create(card);
 	if (ret < 0)
 		return ret;