Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f5077ce authored by Olivier Moysan's avatar Olivier Moysan Committed by Greg Kroah-Hartman
Browse files

ASoC: stm32: dfsdm: fix debugfs warnings on entry creation



[ Upstream commit c47255b61129857b74b0d86eaf59335348be05e0 ]

Register platform component with a prefix, to avoid warnings
on debugfs entries creation, due to component name
redundancy.

Signed-off-by: default avatarOlivier Moysan <olivier.moysan@st.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 33ffe080
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -304,6 +304,7 @@ MODULE_DEVICE_TABLE(of, stm32_adfsdm_of_match);
static int stm32_adfsdm_probe(struct platform_device *pdev)
{
	struct stm32_adfsdm_priv *priv;
	struct snd_soc_component *component;
	int ret;

	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
@@ -331,9 +332,15 @@ static int stm32_adfsdm_probe(struct platform_device *pdev)
	if (IS_ERR(priv->iio_cb))
		return PTR_ERR(priv->iio_cb);

	ret = devm_snd_soc_register_component(&pdev->dev,
					      &stm32_adfsdm_soc_platform,
					      NULL, 0);
	component = devm_kzalloc(&pdev->dev, sizeof(*component), GFP_KERNEL);
	if (!component)
		return -ENOMEM;
#ifdef CONFIG_DEBUG_FS
	component->debugfs_prefix = "pcm";
#endif

	ret = snd_soc_add_component(&pdev->dev, component,
				    &stm32_adfsdm_soc_platform, NULL, 0);
	if (ret < 0)
		dev_err(&pdev->dev, "%s: Failed to register PCM platform\n",
			__func__);
@@ -341,12 +348,20 @@ static int stm32_adfsdm_probe(struct platform_device *pdev)
	return ret;
}

static int stm32_adfsdm_remove(struct platform_device *pdev)
{
	snd_soc_unregister_component(&pdev->dev);

	return 0;
}

static struct platform_driver stm32_adfsdm_driver = {
	.driver = {
		   .name = STM32_ADFSDM_DRV_NAME,
		   .of_match_table = stm32_adfsdm_of_match,
		   },
	.probe = stm32_adfsdm_probe,
	.remove = stm32_adfsdm_remove,
};

module_platform_driver(stm32_adfsdm_driver);