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: opl3: 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/fb5e44d995cf93b8feae22c4558598859712bc07.1765283601.git.u.kleine-koenig@baylibre.com

authored by

Uwe Kleine-König and committed by
Takashi Iwai
376cdcd3 d1c83a79

+5 -8
+5 -8
sound/drivers/opl3/opl3_seq.c
··· 201 201 202 202 /* ------------------------------ */ 203 203 204 - static int snd_opl3_seq_probe(struct device *_dev) 204 + static int snd_opl3_seq_probe(struct snd_seq_device *dev) 205 205 { 206 - struct snd_seq_device *dev = to_seq_dev(_dev); 207 206 struct snd_opl3 *opl3; 208 207 int client, err; 209 208 char name[32]; ··· 243 244 return 0; 244 245 } 245 246 246 - static int snd_opl3_seq_remove(struct device *_dev) 247 + static void snd_opl3_seq_remove(struct snd_seq_device *dev) 247 248 { 248 - struct snd_seq_device *dev = to_seq_dev(_dev); 249 249 struct snd_opl3 *opl3; 250 250 251 251 opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev); 252 252 if (opl3 == NULL) 253 - return -EINVAL; 253 + return; 254 254 255 255 #if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS) 256 256 snd_opl3_free_seq_oss(opl3); ··· 258 260 snd_seq_delete_kernel_client(opl3->seq_client); 259 261 opl3->seq_client = -1; 260 262 } 261 - return 0; 262 263 } 263 264 264 265 static struct snd_seq_driver opl3_seq_driver = { 266 + .probe = snd_opl3_seq_probe, 267 + .remove = snd_opl3_seq_remove, 265 268 .driver = { 266 269 .name = KBUILD_MODNAME, 267 - .probe = snd_opl3_seq_probe, 268 - .remove = snd_opl3_seq_remove, 269 270 }, 270 271 .id = SNDRV_SEQ_DEV_ID_OPL3, 271 272 .argsize = sizeof(struct snd_opl3 *),