]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/asoc-stm32-dfsdm-fix-debugfs-warnings-on-entry-creat.patch
e80f7c5262acda2b3725e1cc15297c23e67550ed
[thirdparty/kernel/stable-queue.git] / queue-4.19 / asoc-stm32-dfsdm-fix-debugfs-warnings-on-entry-creat.patch
1 From 2c51c9ac1cda44e3c54e8633b1e4050e079ef6f8 Mon Sep 17 00:00:00 2001
2 From: Olivier Moysan <olivier.moysan@st.com>
3 Date: Mon, 4 Mar 2019 15:52:44 +0100
4 Subject: ASoC: stm32: dfsdm: fix debugfs warnings on entry creation
5
6 [ Upstream commit c47255b61129857b74b0d86eaf59335348be05e0 ]
7
8 Register platform component with a prefix, to avoid warnings
9 on debugfs entries creation, due to component name
10 redundancy.
11
12 Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
13 Signed-off-by: Mark Brown <broonie@kernel.org>
14 Signed-off-by: Sasha Levin <sashal@kernel.org>
15 ---
16 sound/soc/stm/stm32_adfsdm.c | 21 ++++++++++++++++++---
17 1 file changed, 18 insertions(+), 3 deletions(-)
18
19 diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
20 index 71d341b732a4d..24948b95eb19f 100644
21 --- a/sound/soc/stm/stm32_adfsdm.c
22 +++ b/sound/soc/stm/stm32_adfsdm.c
23 @@ -304,6 +304,7 @@ MODULE_DEVICE_TABLE(of, stm32_adfsdm_of_match);
24 static int stm32_adfsdm_probe(struct platform_device *pdev)
25 {
26 struct stm32_adfsdm_priv *priv;
27 + struct snd_soc_component *component;
28 int ret;
29
30 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
31 @@ -331,9 +332,15 @@ static int stm32_adfsdm_probe(struct platform_device *pdev)
32 if (IS_ERR(priv->iio_cb))
33 return PTR_ERR(priv->iio_cb);
34
35 - ret = devm_snd_soc_register_component(&pdev->dev,
36 - &stm32_adfsdm_soc_platform,
37 - NULL, 0);
38 + component = devm_kzalloc(&pdev->dev, sizeof(*component), GFP_KERNEL);
39 + if (!component)
40 + return -ENOMEM;
41 +#ifdef CONFIG_DEBUG_FS
42 + component->debugfs_prefix = "pcm";
43 +#endif
44 +
45 + ret = snd_soc_add_component(&pdev->dev, component,
46 + &stm32_adfsdm_soc_platform, NULL, 0);
47 if (ret < 0)
48 dev_err(&pdev->dev, "%s: Failed to register PCM platform\n",
49 __func__);
50 @@ -341,12 +348,20 @@ static int stm32_adfsdm_probe(struct platform_device *pdev)
51 return ret;
52 }
53
54 +static int stm32_adfsdm_remove(struct platform_device *pdev)
55 +{
56 + snd_soc_unregister_component(&pdev->dev);
57 +
58 + return 0;
59 +}
60 +
61 static struct platform_driver stm32_adfsdm_driver = {
62 .driver = {
63 .name = STM32_ADFSDM_DRV_NAME,
64 .of_match_table = stm32_adfsdm_of_match,
65 },
66 .probe = stm32_adfsdm_probe,
67 + .remove = stm32_adfsdm_remove,
68 };
69
70 module_platform_driver(stm32_adfsdm_driver);
71 --
72 2.20.1
73