There is warning log after switching to component in driver:
[ 3.321645] fsl-sai
30030000.sai: ASoC: Failed to create component debugfs directory
The reason is there is two component attached with one device,
the components' name are same, then creating debugfs for second
component failed.
This patch is to add debugfs_prefix for platform component to fix
the warning issue.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
int imx_pcm_component_register(struct device *dev)
{
- return devm_snd_soc_register_component(dev, &imx_soc_component,
+ int ret;
+ struct snd_soc_component *component;
+
+ ret = devm_snd_soc_register_component(dev, &imx_soc_component,
NULL, 0);
+ if (ret)
+ return ret;
+
+ component = snd_soc_lookup_component(dev, "imx-pcm-dma-v2");
+ if (!component)
+ return -EINVAL;
+
+#ifdef CONFIG_DEBUG_FS
+ component->debugfs_prefix = "dma";
+#endif
+
+ return 0;
}
EXPORT_SYMBOL_GPL(imx_pcm_component_register);