Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Uwe Kleine-König and committed by
Takashi Iwai
4b8da6d0 94afb5b7

+8 -12
+2 -2
sound/core/seq/oss/seq_oss.c
··· 54 54 */ 55 55 56 56 static struct snd_seq_driver seq_oss_synth_driver = { 57 + .probe = snd_seq_oss_synth_probe, 58 + .remove = snd_seq_oss_synth_remove, 57 59 .driver = { 58 60 .name = KBUILD_MODNAME, 59 - .probe = snd_seq_oss_synth_probe, 60 - .remove = snd_seq_oss_synth_remove, 61 61 }, 62 62 .id = SNDRV_SEQ_DEV_ID_OSS, 63 63 .argsize = sizeof(struct snd_seq_oss_reg),
+4 -8
sound/core/seq/oss/seq_oss_synth.c
··· 80 80 * registration of the synth device 81 81 */ 82 82 int 83 - snd_seq_oss_synth_probe(struct device *_dev) 83 + snd_seq_oss_synth_probe(struct snd_seq_device *dev) 84 84 { 85 - struct snd_seq_device *dev = to_seq_dev(_dev); 86 85 int i; 87 86 struct seq_oss_synth *rec; 88 87 struct snd_seq_oss_reg *reg = SNDRV_SEQ_DEVICE_ARGPTR(dev); ··· 127 128 } 128 129 129 130 130 - int 131 - snd_seq_oss_synth_remove(struct device *_dev) 131 + void 132 + snd_seq_oss_synth_remove(struct snd_seq_device *dev) 132 133 { 133 - struct snd_seq_device *dev = to_seq_dev(_dev); 134 134 int index; 135 135 struct seq_oss_synth *rec = dev->driver_data; 136 136 ··· 140 142 } 141 143 if (index >= max_synth_devs) { 142 144 pr_err("ALSA: seq_oss: can't unregister synth\n"); 143 - return -EINVAL; 145 + return; 144 146 } 145 147 synth_devs[index] = NULL; 146 148 if (index == max_synth_devs - 1) { ··· 158 160 159 161 snd_use_lock_sync(&rec->use_lock); 160 162 kfree(rec); 161 - 162 - return 0; 163 163 } 164 164 165 165
+2 -2
sound/core/seq/oss/seq_oss_synth.h
··· 15 15 #include <sound/seq_device.h> 16 16 17 17 void snd_seq_oss_synth_init(void); 18 - int snd_seq_oss_synth_probe(struct device *dev); 19 - int snd_seq_oss_synth_remove(struct device *dev); 18 + int snd_seq_oss_synth_probe(struct snd_seq_device *dev); 19 + void snd_seq_oss_synth_remove(struct snd_seq_device *dev); 20 20 void snd_seq_oss_synth_setup(struct seq_oss_devinfo *dp); 21 21 void snd_seq_oss_synth_setup_midi(struct seq_oss_devinfo *dp); 22 22 void snd_seq_oss_synth_cleanup(struct seq_oss_devinfo *dp);