audio/sndio: convert to QOM lifecycle methods
Remove the legacy driver init/fini callbacks from the sndio audio backend. Both sndio_audio_init() and sndio_audio_fini() were no-ops that performed no real initialization or cleanup work. Access to the Audiodev is now through hw->s->dev instead of the drv_opaque pointer. Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Marc-André Lureau committed
Jan 16, 2026 at 19:00 UTC
f895d598f2e67aeae87bcf343cda00d5e53f6493
1 file changed
+2
-14
audio/sndioaudio.c
+2
-14
@@ -499,7 +499,7 @@ static int sndio_init_out(HWVoiceOut *hw, struct audsettings *as, void *opaque)
499
{
500
SndioVoice *self = (SndioVoice *) hw;
501
502
- if (sndio_init(self, as, SIO_PLAY, opaque) == -1) {
502
+ if (sndio_init(self, as, SIO_PLAY, hw->s->dev) == -1) {
503
return -1;
504
}
505
@@ -512,7 +512,7 @@ static int sndio_init_in(HWVoiceIn *hw, struct audsettings *as, void *opaque)
512
{
513
SndioVoice *self = (SndioVoice *) hw;
514
515
- if (sndio_init(self, as, SIO_REC, opaque) == -1) {
515
+ if (sndio_init(self, as, SIO_REC, hw->s->dev) == -1) {
516
return -1;
517
}
518
@@ -535,16 +535,6 @@ static void sndio_fini_in(HWVoiceIn *hw)
535
sndio_fini(self);
536
}
537
538
-static void *sndio_audio_init(Audiodev *dev, Error **errp)
539
-{
540
- assert(dev->driver == AUDIODEV_DRIVER_SNDIO);
541
- return dev;
542
-}
543
-
544
-static void sndio_audio_fini(void *opaque)
545
-{
546
-}
547
-
538
static struct audio_pcm_ops sndio_pcm_ops = {
539
.init_out = sndio_init_out,
540
.fini_out = sndio_fini_out,
@@ -563,8 +553,6 @@ static struct audio_pcm_ops sndio_pcm_ops = {
553
554
static struct audio_driver sndio_audio_driver = {
555
.name = "sndio",
566
- .init = sndio_audio_init,
567
- .fini = sndio_audio_fini,
556
.pcm_ops = &sndio_pcm_ops,
557
.max_voices_out = INT_MAX,
558
.max_voices_in = INT_MAX,