@@ -89,7 +89,7 @@ int sof_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
8989 .id = swidget -> comp_id ,
9090 };
9191 struct sof_ipc_reply reply ;
92- int ret , ret1 , core ;
92+ int ret , ret1 ;
9393
9494 if (!swidget -> private )
9595 return 0 ;
@@ -98,14 +98,9 @@ int sof_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
9898 if (-- swidget -> use_count )
9999 return 0 ;
100100
101- core = swidget -> core ;
102-
103101 switch (swidget -> id ) {
104102 case snd_soc_dapm_scheduler :
105103 {
106- const struct sof_ipc_pipe_new * pipeline = swidget -> private ;
107-
108- core = pipeline -> core ;
109104 ipc_free .hdr .cmd |= SOF_IPC_TPLG_PIPE_FREE ;
110105 break ;
111106 }
@@ -135,10 +130,10 @@ int sof_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
135130 * disable widget core. continue to route setup status and complete flag
136131 * even if this fails and return the appropriate error
137132 */
138- ret1 = snd_sof_dsp_core_put (sdev , core );
133+ ret1 = snd_sof_dsp_core_put (sdev , swidget -> core );
139134 if (ret1 < 0 ) {
140135 dev_err (sdev -> dev , "error: failed to disable target core: %d for widget %s\n" ,
141- core , swidget -> widget -> name );
136+ swidget -> core , swidget -> widget -> name );
142137 if (!ret )
143138 ret = ret1 ;
144139 }
@@ -163,7 +158,6 @@ int sof_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
163158 struct snd_sof_dai * dai ;
164159 size_t ipc_size ;
165160 int ret ;
166- int core ;
167161
168162 /* skip if there is no private data */
169163 if (!swidget -> private )
@@ -173,15 +167,8 @@ int sof_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
173167 if (++ swidget -> use_count > 1 )
174168 return 0 ;
175169
176- /* set core ID */
177- core = swidget -> core ;
178- if (swidget -> id == snd_soc_dapm_scheduler ) {
179- pipeline = swidget -> private ;
180- core = pipeline -> core ;
181- }
182-
183170 /* enable widget core */
184- ret = snd_sof_dsp_core_get (sdev , core );
171+ ret = snd_sof_dsp_core_get (sdev , swidget -> core );
185172 if (ret < 0 ) {
186173 dev_err (sdev -> dev , "error: failed to enable target core for widget %s\n" ,
187174 swidget -> widget -> name );
@@ -261,7 +248,7 @@ int sof_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
261248 return 0 ;
262249
263250core_put :
264- snd_sof_dsp_core_put (sdev , core );
251+ snd_sof_dsp_core_put (sdev , swidget -> core );
265252use_count_dec :
266253 swidget -> use_count -- ;
267254 return ret ;
0 commit comments