Commit da893a93 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown

ASOC: SOF: Intel: use snd_soc_dai_get_widget()

We have a helper, use it to simplify widget lookup
Suggested-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@intel.com>
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211224021034.26635-2-yung-chuan.liao@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2f15d3ce
...@@ -189,10 +189,7 @@ static int sdw_params_stream(struct device *dev, ...@@ -189,10 +189,7 @@ static int sdw_params_stream(struct device *dev,
struct snd_soc_dai *d = params_data->dai; struct snd_soc_dai *d = params_data->dai;
struct snd_soc_dapm_widget *w; struct snd_soc_dapm_widget *w;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) w = snd_soc_dai_get_widget(d, substream->stream);
w = d->playback_widget;
else
w = d->capture_widget;
return sdw_dai_config_ipc(sdev, w, params_data->link_id, params_data->alh_stream_id, return sdw_dai_config_ipc(sdev, w, params_data->link_id, params_data->alh_stream_id,
d->id, true); d->id, true);
...@@ -206,10 +203,7 @@ static int sdw_free_stream(struct device *dev, ...@@ -206,10 +203,7 @@ static int sdw_free_stream(struct device *dev,
struct snd_soc_dai *d = free_data->dai; struct snd_soc_dai *d = free_data->dai;
struct snd_soc_dapm_widget *w; struct snd_soc_dapm_widget *w;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) w = snd_soc_dai_get_widget(d, substream->stream);
w = d->playback_widget;
else
w = d->capture_widget;
/* send invalid stream_id */ /* send invalid stream_id */
return sdw_dai_config_ipc(sdev, w, free_data->link_id, 0xFFFF, d->id, false); return sdw_dai_config_ipc(sdev, w, free_data->link_id, 0xFFFF, d->id, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment