--- zzzz-none-000/linux-3.10.107/sound/pci/echoaudio/midi.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/pci/echoaudio/midi.c 2021-02-04 17:41:59.000000000 +0000 @@ -36,7 +36,7 @@ /* Start and stop Midi input */ static int enable_midi_input(struct echoaudio *chip, char enable) { - DE_MID(("enable_midi_input(%d)\n", enable)); + dev_dbg(chip->card->dev, "enable_midi_input(%d)\n", enable); if (wait_handshake(chip)) return -EIO; @@ -74,7 +74,7 @@ chip->comm_page->midi_out_free_count = 0; clear_handshake(chip); send_vector(chip, DSP_VC_MIDI_WRITE); - DE_MID(("write_midi: %d\n", bytes)); + dev_dbg(chip->card->dev, "write_midi: %d\n", bytes); return bytes; } @@ -157,7 +157,6 @@ struct echoaudio *chip = substream->rmidi->private_data; chip->midi_in = substream; - DE_MID(("rawmidi_iopen\n")); return 0; } @@ -183,7 +182,6 @@ struct echoaudio *chip = substream->rmidi->private_data; chip->midi_in = NULL; - DE_MID(("rawmidi_iclose\n")); return 0; } @@ -196,7 +194,6 @@ chip->tinuse = 0; chip->midi_full = 0; chip->midi_out = substream; - DE_MID(("rawmidi_oopen\n")); return 0; } @@ -209,7 +206,6 @@ int bytes, sent, time; unsigned char buf[MIDI_OUT_BUFFER_SIZE - 1]; - DE_MID(("snd_echo_midi_output_write\n")); /* No interrupts are involved: we have to check at regular intervals if the card's output buffer has room for new data. */ sent = bytes = 0; @@ -218,20 +214,21 @@ if (!snd_rawmidi_transmit_empty(chip->midi_out)) { bytes = snd_rawmidi_transmit_peek(chip->midi_out, buf, MIDI_OUT_BUFFER_SIZE - 1); - DE_MID(("Try to send %d bytes...\n", bytes)); + dev_dbg(chip->card->dev, "Try to send %d bytes...\n", bytes); sent = write_midi(chip, buf, bytes); if (sent < 0) { - snd_printk(KERN_ERR "write_midi() error %d\n", sent); + dev_err(chip->card->dev, + "write_midi() error %d\n", sent); /* retry later */ sent = 9000; chip->midi_full = 1; } else if (sent > 0) { - DE_MID(("%d bytes sent\n", sent)); + dev_dbg(chip->card->dev, "%d bytes sent\n", sent); snd_rawmidi_transmit_ack(chip->midi_out, sent); } else { /* Buffer is full. DSP's internal buffer is 64 (128 ?) bytes long. Let's wait until half of them are sent */ - DE_MID(("Full\n")); + dev_dbg(chip->card->dev, "Full\n"); sent = 32; chip->midi_full = 1; } @@ -243,7 +240,8 @@ sent */ time = (sent << 3) / 25 + 1; /* 8/25=0.32ms to send a byte */ mod_timer(&chip->timer, jiffies + (time * HZ + 999) / 1000); - DE_MID(("Timer armed(%d)\n", ((time * HZ + 999) / 1000))); + dev_dbg(chip->card->dev, + "Timer armed(%d)\n", ((time * HZ + 999) / 1000)); } spin_unlock_irqrestore(&chip->lock, flags); } @@ -255,13 +253,12 @@ { struct echoaudio *chip = substream->rmidi->private_data; - DE_MID(("snd_echo_midi_output_trigger(%d)\n", up)); + dev_dbg(chip->card->dev, "snd_echo_midi_output_trigger(%d)\n", up); spin_lock_irq(&chip->lock); if (up) { if (!chip->tinuse) { - init_timer(&chip->timer); - chip->timer.function = snd_echo_midi_output_write; - chip->timer.data = (unsigned long)chip; + setup_timer(&chip->timer, snd_echo_midi_output_write, + (unsigned long)chip); chip->tinuse = 1; } } else { @@ -269,7 +266,7 @@ chip->tinuse = 0; spin_unlock_irq(&chip->lock); del_timer_sync(&chip->timer); - DE_MID(("Timer removed\n")); + dev_dbg(chip->card->dev, "Timer removed\n"); return; } } @@ -286,7 +283,6 @@ struct echoaudio *chip = substream->rmidi->private_data; chip->midi_out = NULL; - DE_MID(("rawmidi_oclose\n")); return 0; } @@ -326,6 +322,5 @@ chip->rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | SNDRV_RAWMIDI_INFO_INPUT | SNDRV_RAWMIDI_INFO_DUPLEX; - DE_INIT(("MIDI ok\n")); return 0; }