ASoC: SOF: Intel: hda: move helper to static inline
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 2 Apr 2024 15:18:22 +0000 (10:18 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 2 Apr 2024 16:14:52 +0000 (17:14 +0100)
To allow using widget_to_sdev() in other files, move it as static inline
in shared header file.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda-dai.c
sound/soc/sof/intel/hda.h

index 86c2325e594910a4d5fdd5e35eb4e78ab98fd6b9..3f2fd84907d2fad729bc6c2a3b11c153205988f8 100644 (file)
@@ -29,14 +29,6 @@ static bool hda_use_tplg_nhlt;
 module_param_named(sof_use_tplg_nhlt, hda_use_tplg_nhlt, bool, 0444);
 MODULE_PARM_DESC(sof_use_tplg_nhlt, "SOF topology nhlt override");
 
-static struct snd_sof_dev *widget_to_sdev(struct snd_soc_dapm_widget *w)
-{
-       struct snd_sof_widget *swidget = w->dobj.private;
-       struct snd_soc_component *component = swidget->scomp;
-
-       return snd_soc_component_get_drvdata(component);
-}
-
 int hda_dai_config(struct snd_soc_dapm_widget *w, unsigned int flags,
                   struct snd_sof_dai_config_data *data)
 {
index 3bf7427dc918b27a4d13bd84610a5357771fc83e..f530a05cfc92805c88c8273da9ace26ee5433bf7 100644 (file)
@@ -1000,4 +1000,12 @@ int hda_dai_config(struct snd_soc_dapm_widget *w, unsigned int flags,
 int hda_link_dma_cleanup(struct snd_pcm_substream *substream, struct hdac_ext_stream *hext_stream,
                         struct snd_soc_dai *cpu_dai);
 
+static inline struct snd_sof_dev *widget_to_sdev(struct snd_soc_dapm_widget *w)
+{
+       struct snd_sof_widget *swidget = w->dobj.private;
+       struct snd_soc_component *component = swidget->scomp;
+
+       return snd_soc_component_get_drvdata(component);
+}
+
 #endif