summaryrefslogtreecommitdiff
path: root/sound/soc/stm/stm32_adfsdm.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-21 12:21:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-21 12:21:53 +0300
commit05df6ab8eba625a1d97eb67ee06d786b8e460685 (patch)
tree7fed59b7f49fd8d816475ca6b20c95c7f837ca6f /sound/soc/stm/stm32_adfsdm.c
parent1d926e259d8f8195fdfaeea7951149001894b473 (diff)
parenteb7081409f94a9a8608593d0fb63a1aa3d6f95d8 (diff)
downloadlinux-05df6ab8eba625a1d97eb67ee06d786b8e460685.tar.xz
Merge 6.1-rc6 into driver-core-next
We need the kernfs changes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/soc/stm/stm32_adfsdm.c')
-rw-r--r--sound/soc/stm/stm32_adfsdm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
index 643fc8a17018..837c1848d9bf 100644
--- a/sound/soc/stm/stm32_adfsdm.c
+++ b/sound/soc/stm/stm32_adfsdm.c
@@ -304,6 +304,11 @@ static int stm32_adfsdm_dummy_cb(const void *data, void *private)
return 0;
}
+static void stm32_adfsdm_cleanup(void *data)
+{
+ iio_channel_release_all_cb(data);
+}
+
static struct snd_soc_component_driver stm32_adfsdm_soc_platform = {
.open = stm32_adfsdm_pcm_open,
.close = stm32_adfsdm_pcm_close,
@@ -350,6 +355,12 @@ static int stm32_adfsdm_probe(struct platform_device *pdev)
if (IS_ERR(priv->iio_cb))
return PTR_ERR(priv->iio_cb);
+ ret = devm_add_action_or_reset(&pdev->dev, stm32_adfsdm_cleanup, priv->iio_cb);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "Unable to add action\n");
+ return ret;
+ }
+
component = devm_kzalloc(&pdev->dev, sizeof(*component), GFP_KERNEL);
if (!component)
return -ENOMEM;