diff options
| author | Uwe Kleine-König <u.kleine-koenig@baylibre.com> | 2025-12-09 15:38:44 +0300 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-12-14 13:08:09 +0300 |
| commit | 2e514916e90fd709c07be2a9e2965aa0c66997ee (patch) | |
| tree | a3442dbd85d1ac357d898c4cbcffe073ce7f656a | |
| parent | a89f7f08182954f51fcec1c8c65dec0c6cfc778e (diff) | |
| download | linux-2e514916e90fd709c07be2a9e2965aa0c66997ee.tar.xz | |
ALSA: seq: midi: 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 -ENODEV` 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/054ae56db6b55eea60c8aa8f9633e8d3d180cb09.1765283601.git.u.kleine-koenig@baylibre.com
| -rw-r--r-- | sound/core/seq/seq_midi.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c index 581e138a3115..de7ec7d15f23 100644 --- a/sound/core/seq/seq_midi.c +++ b/sound/core/seq/seq_midi.c @@ -265,9 +265,8 @@ static void snd_seq_midisynth_delete(struct seq_midisynth *msynth) /* register new midi synth port */ static int -snd_seq_midisynth_probe(struct device *_dev) +snd_seq_midisynth_probe(struct snd_seq_device *dev) { - struct snd_seq_device *dev = to_seq_dev(_dev); struct seq_midisynth_client *client; struct seq_midisynth *msynth, *ms; struct snd_seq_port_info *port __free(kfree) = NULL; @@ -411,10 +410,9 @@ snd_seq_midisynth_probe(struct device *_dev) } /* release midi synth port */ -static int -snd_seq_midisynth_remove(struct device *_dev) +static void +snd_seq_midisynth_remove(struct snd_seq_device *dev) { - struct snd_seq_device *dev = to_seq_dev(_dev); struct seq_midisynth_client *client; struct seq_midisynth *msynth; struct snd_card *card = dev->card; @@ -423,7 +421,7 @@ snd_seq_midisynth_remove(struct device *_dev) guard(mutex)(®ister_mutex); client = synths[card->number]; if (client == NULL || client->ports[device] == NULL) - return -ENODEV; + return; ports = client->ports_per_device[device]; client->ports_per_device[device] = 0; msynth = client->ports[device]; @@ -437,14 +435,13 @@ snd_seq_midisynth_remove(struct device *_dev) synths[card->number] = NULL; kfree(client); } - return 0; } static struct snd_seq_driver seq_midisynth_driver = { + .probe = snd_seq_midisynth_probe, + .remove = snd_seq_midisynth_remove, .driver = { .name = KBUILD_MODNAME, - .probe = snd_seq_midisynth_probe, - .remove = snd_seq_midisynth_remove, }, .id = SNDRV_SEQ_DEV_ID_MIDISYNTH, .argsize = 0, |
