From f895d598f2e67aeae87bcf343cda00d5e53f6493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 16 Jan 2026 19:00:44 +0400 Subject: [PATCH] audio/sndio: convert to QOM lifecycle methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Akihiko Odaki Signed-off-by: Marc-André Lureau --- audio/sndioaudio.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/audio/sndioaudio.c b/audio/sndioaudio.c index 2a9ae42992..c15d8b6684 100644 --- a/audio/sndioaudio.c +++ b/audio/sndioaudio.c @@ -499,7 +499,7 @@ static int sndio_init_out(HWVoiceOut *hw, struct audsettings *as, void *opaque) { SndioVoice *self = (SndioVoice *) hw; - if (sndio_init(self, as, SIO_PLAY, opaque) == -1) { + if (sndio_init(self, as, SIO_PLAY, hw->s->dev) == -1) { return -1; } @@ -512,7 +512,7 @@ static int sndio_init_in(HWVoiceIn *hw, struct audsettings *as, void *opaque) { SndioVoice *self = (SndioVoice *) hw; - if (sndio_init(self, as, SIO_REC, opaque) == -1) { + if (sndio_init(self, as, SIO_REC, hw->s->dev) == -1) { return -1; } @@ -535,16 +535,6 @@ static void sndio_fini_in(HWVoiceIn *hw) sndio_fini(self); } -static void *sndio_audio_init(Audiodev *dev, Error **errp) -{ - assert(dev->driver == AUDIODEV_DRIVER_SNDIO); - return dev; -} - -static void sndio_audio_fini(void *opaque) -{ -} - static struct audio_pcm_ops sndio_pcm_ops = { .init_out = sndio_init_out, .fini_out = sndio_fini_out, @@ -563,8 +553,6 @@ static struct audio_pcm_ops sndio_pcm_ops = { static struct audio_driver sndio_audio_driver = { .name = "sndio", - .init = sndio_audio_init, - .fini = sndio_audio_fini, .pcm_ops = &sndio_pcm_ops, .max_voices_out = INT_MAX, .max_voices_in = INT_MAX,