summaryrefslogtreecommitdiff
path: root/sound/core/rawmidi.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-05-23 09:53:23 +0200
committerTakashi Iwai <tiwai@suse.de>2023-05-23 12:10:53 +0200
commitfb3bd1215909866d6105224abe1566fd52695859 (patch)
tree48161e37c9de129d780a2531d7aa122ebaf860f9 /sound/core/rawmidi.c
parent09b62892ddeeb38c11979979e3c65a14dba5fdc6 (diff)
ALSA: rawmidi: Add ioctl callback to snd_rawmidi_global_ops
A new callback, ioctl, is added to snd_rawmidi_global_ops for allowing the driver to deal with the own ioctls. This is another preparation patch for the upcoming UMP support. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230523075358.9672-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/rawmidi.c')
-rw-r--r--sound/core/rawmidi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index 589b75087d27..ab28cfc1fac8 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -893,6 +893,7 @@ static int snd_rawmidi_ioctl_status64(struct snd_rawmidi_file *rfile,
static long snd_rawmidi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct snd_rawmidi_file *rfile;
+ struct snd_rawmidi *rmidi;
void __user *argp = (void __user *)arg;
rfile = file->private_data;
@@ -984,8 +985,10 @@ static long snd_rawmidi_ioctl(struct file *file, unsigned int cmd, unsigned long
}
}
default:
- rmidi_dbg(rfile->rmidi,
- "rawmidi: unknown command = 0x%x\n", cmd);
+ rmidi = rfile->rmidi;
+ if (rmidi->ops && rmidi->ops->ioctl)
+ return rmidi->ops->ioctl(rmidi, cmd, argp);
+ rmidi_dbg(rmidi, "rawmidi: unknown command = 0x%x\n", cmd);
}
return -ENOTTY;
}