}
                        }
                } else if (clientid >= 64 && clientid < 128) {
-                       int card = (clientid - 64) / 8;
+                       int card = (clientid - 64) / 4;
                        if (card < snd_ecards_limit) {
                                if (! card_requested[card]) {
                                        card_requested[card] = 1;
 
        if (callback == NULL)
                return -EINVAL;
-       if (card && client_index > 7)
+       if (card && client_index > 3)
                return -EINVAL;
        if (card == NULL && client_index > 63)
                return -EINVAL;
        if (card)
-               client_index += 64 + (card->number << 3);
+               client_index += 64 + (card->number << 2);
 
        if (down_interruptible(®ister_mutex))
                return -ERESTARTSYS;
 
 MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("{{ALSA,Virtual rawmidi device}}");
 
-#define MAX_MIDI_DEVICES       8
+#define MAX_MIDI_DEVICES       4
 
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;     /* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;      /* ID for this card */
 module_param_array(enable, bool, NULL, 0444);
 MODULE_PARM_DESC(enable, "Enable this soundcard.");
 module_param_array(midi_devs, int, NULL, 0444);
-MODULE_PARM_DESC(midi_devs, "MIDI devices # (1-8)");
+MODULE_PARM_DESC(midi_devs, "MIDI devices # (1-4)");
 
 struct snd_card_virmidi {
        struct snd_card *card;