ASoC: SOF: pipelines: Harmonize all functions to use struct snd_sof_dev

First thing the pipelines function which have "struct device *dev" as
parameter do is:
struct snd_sof_dev *sdev = dev_get_drvdata(dev);

and in all cases the passed dev is actually coming from sdev->dev.

Skip this steps and pass directly the sdev to all pipelines related
functions as few of them already does this.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006111651.10027-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Peter Ujfalusi
2021-10-06 14:16:51 +03:00
committed by Mark Brown
parent ec626334ea
commit d8a15e5fca
4 changed files with 18 additions and 22 deletions

View File

@@ -203,7 +203,7 @@ int sof_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
break;
case snd_soc_dapm_scheduler:
pipeline = swidget->private;
ret = sof_load_pipeline_ipc(sdev->dev, pipeline, &r);
ret = sof_load_pipeline_ipc(sdev, pipeline, &r);
break;
default:
hdr = swidget->private;
@@ -428,7 +428,7 @@ int sof_widget_list_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm, in
if (pipe_widget->complete)
continue;
pipe_widget->complete = snd_sof_complete_pipeline(sdev->dev, pipe_widget);
pipe_widget->complete = snd_sof_complete_pipeline(sdev, pipe_widget);
if (pipe_widget->complete < 0) {
ret = pipe_widget->complete;
goto widget_free;
@@ -593,9 +593,8 @@ const struct sof_ipc_pipe_new *snd_sof_pipeline_find(struct snd_sof_dev *sdev,
return NULL;
}
int sof_set_up_pipelines(struct device *dev, bool verify)
int sof_set_up_pipelines(struct snd_sof_dev *sdev, bool verify)
{
struct snd_sof_dev *sdev = dev_get_drvdata(dev);
struct snd_sof_widget *swidget;
struct snd_sof_route *sroute;
int ret;
@@ -654,7 +653,7 @@ int sof_set_up_pipelines(struct device *dev, bool verify)
continue;
swidget->complete =
snd_sof_complete_pipeline(dev, swidget);
snd_sof_complete_pipeline(sdev, swidget);
break;
default:
break;
@@ -668,9 +667,8 @@ int sof_set_up_pipelines(struct device *dev, bool verify)
* This function doesn't free widgets during suspend. It only resets the set up status for all
* routes and use_count for all widgets.
*/
int sof_tear_down_pipelines(struct device *dev, bool verify)
int sof_tear_down_pipelines(struct snd_sof_dev *sdev, bool verify)
{
struct snd_sof_dev *sdev = dev_get_drvdata(dev);
struct snd_sof_widget *swidget;
struct snd_sof_route *sroute;
int ret;