diff options
| author | Uwe Kleine-König <u.kleine-koenig@baylibre.com> | 2025-12-09 13:38:50 +0100 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-12-14 11:08:09 +0100 |
| commit | 4b8da6d08944f78b17bd9e846c8e3e38625088a6 (patch) | |
| tree | ca657b6cf3ac6feca4ad3a70e1450c202b834c2e | |
| parent | 94afb5b7a130f3842baf0aa1fd936b2c7d73cbbd (diff) | |
ALSA: seq: oss: Convert to snd_seq bus probe mechanism
The snd_seq bus got a dedicated probe function. Make use of that. This
fixes a runtime warning about the driver needing to be converted to the
bus probe method.
Note that the remove callback returns void now. The actual return value
was ignored before (see device_remove() in drivers/base/dd.c), so there
is no problem introduced by converting `return -EINVAL` to `return`.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/affb5a7107e9d678ce85dc7f0b87445928cd6b94.1765283601.git.u.kleine-koenig@baylibre.com
| -rw-r--r-- | sound/core/seq/oss/seq_oss.c | 4 | ||||
| -rw-r--r-- | sound/core/seq/oss/seq_oss_synth.c | 12 | ||||
| -rw-r--r-- | sound/core/seq/oss/seq_oss_synth.h | 4 |
3 files changed, 8 insertions, 12 deletions
diff --git a/sound/core/seq/oss/seq_oss.c b/sound/core/seq/oss/seq_oss.c index 02d30d8b6c3a..021cd70f90db 100644 --- a/sound/core/seq/oss/seq_oss.c +++ b/sound/core/seq/oss/seq_oss.c @@ -54,10 +54,10 @@ static __poll_t odev_poll(struct file *file, poll_table * wait); */ static struct snd_seq_driver seq_oss_synth_driver = { + .probe = snd_seq_oss_synth_probe, + .remove = snd_seq_oss_synth_remove, .driver = { .name = KBUILD_MODNAME, - .probe = snd_seq_oss_synth_probe, - .remove = snd_seq_oss_synth_remove, }, .id = SNDRV_SEQ_DEV_ID_OSS, .argsize = sizeof(struct snd_seq_oss_reg), diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c index 8c4e5913c7e6..68bc6d4eed53 100644 --- a/sound/core/seq/oss/seq_oss_synth.c +++ b/sound/core/seq/oss/seq_oss_synth.c @@ -80,9 +80,8 @@ snd_seq_oss_synth_init(void) * registration of the synth device */ int -snd_seq_oss_synth_probe(struct device *_dev) +snd_seq_oss_synth_probe(struct snd_seq_device *dev) { - struct snd_seq_device *dev = to_seq_dev(_dev); int i; struct seq_oss_synth *rec; struct snd_seq_oss_reg *reg = SNDRV_SEQ_DEVICE_ARGPTR(dev); @@ -128,10 +127,9 @@ snd_seq_oss_synth_probe(struct device *_dev) } -int -snd_seq_oss_synth_remove(struct device *_dev) +void +snd_seq_oss_synth_remove(struct snd_seq_device *dev) { - struct snd_seq_device *dev = to_seq_dev(_dev); int index; struct seq_oss_synth *rec = dev->driver_data; @@ -142,7 +140,7 @@ snd_seq_oss_synth_remove(struct device *_dev) } if (index >= max_synth_devs) { pr_err("ALSA: seq_oss: can't unregister synth\n"); - return -EINVAL; + return; } synth_devs[index] = NULL; if (index == max_synth_devs - 1) { @@ -160,8 +158,6 @@ snd_seq_oss_synth_remove(struct device *_dev) snd_use_lock_sync(&rec->use_lock); kfree(rec); - - return 0; } diff --git a/sound/core/seq/oss/seq_oss_synth.h b/sound/core/seq/oss/seq_oss_synth.h index ffc40d8a7ef1..f52283904cba 100644 --- a/sound/core/seq/oss/seq_oss_synth.h +++ b/sound/core/seq/oss/seq_oss_synth.h @@ -15,8 +15,8 @@ #include <sound/seq_device.h> void snd_seq_oss_synth_init(void); -int snd_seq_oss_synth_probe(struct device *dev); -int snd_seq_oss_synth_remove(struct device *dev); +int snd_seq_oss_synth_probe(struct snd_seq_device *dev); +void snd_seq_oss_synth_remove(struct snd_seq_device *dev); void snd_seq_oss_synth_setup(struct seq_oss_devinfo *dp); void snd_seq_oss_synth_setup_midi(struct seq_oss_devinfo *dp); void snd_seq_oss_synth_cleanup(struct seq_oss_devinfo *dp); |
