@@ -352,5 +352,7 @@ struct page *snd_soc_component_page(struct snd_soc_component *component,
int snd_soc_component_mmap(struct snd_soc_component *component,
struct snd_pcm_substream *substream,
struct vm_area_struct *vma);
+int snd_soc_component_pcm_new(struct snd_soc_component *component,
+ struct snd_soc_pcm_runtime *rtd);
#endif /* __SOC_COMPONENT_H */
@@ -403,3 +403,12 @@ int snd_soc_component_mmap(struct snd_soc_component *component,
return -ENOTSUPP;
}
+
+int snd_soc_component_pcm_new(struct snd_soc_component *component,
+ struct snd_soc_pcm_runtime *rtd)
+{
+ if (component->driver->pcm_new)
+ return component->driver->pcm_new(rtd);
+
+ return 0;
+}
@@ -3089,10 +3089,7 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
for_each_rtdcom(rtd, rtdcom) {
component = rtdcom->component;
- if (!component->driver->pcm_new)
- continue;
-
- ret = component->driver->pcm_new(rtd);
+ ret = snd_soc_component_pcm_new(component, rtd);
if (ret < 0) {
dev_err(component->dev,
"ASoC: pcm constructor failed: %d\n",