ALSA: seq: add an alternative way to handle ioctl requests
[cascardo/linux.git] / sound / core / seq / seq_compat.c
index 6517590..4cfc505 100644 (file)
@@ -59,6 +59,9 @@ static int snd_seq_call_port_info_ioctl(struct snd_seq_client *client, unsigned
                goto error;
        data->kernel = NULL;
 
+       if (snd_seq_kernel_client_ctl(client->number, cmd, &data) >= 0)
+               return 0;
+
        fs = snd_enter_user();
        err = snd_seq_do_ioctl(client, cmd, data);
        snd_leave_user(fs);
@@ -123,6 +126,8 @@ static long snd_seq_ioctl_compat(struct file *file, unsigned int cmd, unsigned l
        case SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION:
        case SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT:
        case SNDRV_SEQ_IOCTL_RUNNING_MODE:
+               if (seq_ioctl(file, cmd, arg) >= 0)
+                       return 0;
                return snd_seq_do_ioctl(client, cmd, argp);
        case SNDRV_SEQ_IOCTL_CREATE_PORT32:
                return snd_seq_call_port_info_ioctl(client, SNDRV_SEQ_IOCTL_CREATE_PORT, argp);