summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>2025-12-09 13:38:46 +0100
committerTakashi Iwai <tiwai@suse.de>2025-12-14 11:08:09 +0100
commit376cdcd3ff18c08540178bc95e1dba49228cd2bd (patch)
tree567f2a30890582ccf23d067f38b765a93631bddf
parentd1c83a79e3985e7d5961dfe8adb76e1d9a624fb2 (diff)
downloadlinux-376cdcd3ff18c08540178bc95e1dba49228cd2bd.tar.gz
linux-376cdcd3ff18c08540178bc95e1dba49228cd2bd.zip
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
-rw-r--r--sound/drivers/opl3/opl3_seq.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c
index d3278428d360..b77d8e8f12fb 100644
--- a/sound/drivers/opl3/opl3_seq.c
+++ b/sound/drivers/opl3/opl3_seq.c
@@ -201,9 +201,8 @@ static int snd_opl3_synth_create_port(struct snd_opl3 * opl3)
/* ------------------------------ */
-static int snd_opl3_seq_probe(struct device *_dev)
+static int snd_opl3_seq_probe(struct snd_seq_device *dev)
{
- struct snd_seq_device *dev = to_seq_dev(_dev);
struct snd_opl3 *opl3;
int client, err;
char name[32];
@@ -244,14 +243,13 @@ static int snd_opl3_seq_probe(struct device *_dev)
return 0;
}
-static int snd_opl3_seq_remove(struct device *_dev)
+static void snd_opl3_seq_remove(struct snd_seq_device *dev)
{
- struct snd_seq_device *dev = to_seq_dev(_dev);
struct snd_opl3 *opl3;
opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
if (opl3 == NULL)
- return -EINVAL;
+ return;
#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
snd_opl3_free_seq_oss(opl3);
@@ -260,14 +258,13 @@ static int snd_opl3_seq_remove(struct device *_dev)
snd_seq_delete_kernel_client(opl3->seq_client);
opl3->seq_client = -1;
}
- return 0;
}
static struct snd_seq_driver opl3_seq_driver = {
+ .probe = snd_opl3_seq_probe,
+ .remove = snd_opl3_seq_remove,
.driver = {
.name = KBUILD_MODNAME,
- .probe = snd_opl3_seq_probe,
- .remove = snd_opl3_seq_remove,
},
.id = SNDRV_SEQ_DEV_ID_OPL3,
.argsize = sizeof(struct snd_opl3 *),