summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-12-17 12:06:24 +1100
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-12-17 12:07:45 +1100
commit31404f8a4c74acc2a7e8040bfcff543c1e2270a1 (patch)
treec66827cf033353575b24cb6e027bfd199d952293
parente9a03571f6a889e69dadbb075494229cbcd7ba53 (diff)
We can achieve this using the snd_device_register function Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
-rw-r--r--core.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/core.c b/core.c
index 8d73ed1..2fd416e 100644
--- a/core.c
+++ b/core.c
@@ -287,6 +287,8 @@ static struct snd_pcm *pcm_create(struct snd_avirt_stream *stream)
// Set the private free function for the private user data
pcm->private_free = pcm_private_data_free;
+ snd_device_register(core.card, pcm);
+
return pcm;
}
@@ -458,12 +460,6 @@ int snd_avirt_streams_seal(void)
ap_obj->path->configure(core.card, &stream_array);
}
- err = snd_card_register(core.card);
- if (err < 0) {
- D_ERRORK("Sound card registration failed!");
- snd_card_free(core.card);
- }
-
core.streams_sealed = true;
return err;
@@ -573,6 +569,12 @@ static int __init snd_avirt_core_init(void)
goto exit_class_container;
}
+ err = snd_card_register(core.card);
+ if (err < 0) {
+ D_ERRORK("Sound card registration failed!");
+ snd_card_free(core.card);
+ }
+
err = snd_avirt_configfs_init(&core);
if (err < 0)
goto exit_kset;