diff options
author | Peter Ujfalusi <peter.ujfalusi@linux.intel.com> | 2021-10-06 14:16:51 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-10-07 17:45:45 +0300 |
commit | d8a15e5fcae132dc6a44847535ce355f6fba46f8 (patch) | |
tree | 71de0fea8aae2c0cb237408449bbb22a953ca11c /sound/soc/sof/sof-audio.c | |
parent | ec626334eaffe101df9ed79e161eba95124e64ad (diff) | |
download | linux-d8a15e5fcae132dc6a44847535ce355f6fba46f8.tar.xz |
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>
Diffstat (limited to 'sound/soc/sof/sof-audio.c')
-rw-r--r-- | sound/soc/sof/sof-audio.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c index 262cb3ad4674..7cbe757c1fe2 100644 --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@ -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; |