]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ALSA: emux: Use setup_timer() and mod_timer()
authorTakashi Iwai <tiwai@suse.de>
Mon, 19 Jan 2015 10:41:13 +0000 (11:41 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 19 Jan 2015 10:41:13 +0000 (11:41 +0100)
No functional change, refactoring with the standard helpers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/synth/emux/emux.c
sound/synth/emux/emux_synth.c

index f27a1c85f81bc0fb4976e9f1b705ccd3b246090e..49195325fdf6c6f7fe74ac50e3e4c3466c4ff60d 100644 (file)
@@ -53,9 +53,7 @@ int snd_emux_new(struct snd_emux **remu)
        emu->max_voices = 0;
        emu->use_time = 0;
 
-       init_timer(&emu->tlist);
-       emu->tlist.function = snd_emux_timer_callback;
-       emu->tlist.data = (unsigned long)emu;
+       setup_timer(&emu->tlist, snd_emux_timer_callback, (unsigned long)emu);
        emu->timer_active = 0;
 
        *remu = emu;
index 9a38de459acb059db4d12b3ca1c9955adeebed60..599551b5af44cae35477cb010ae380d53009229c 100644 (file)
@@ -186,8 +186,7 @@ snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan)
                                 */
                                vp->state = SNDRV_EMUX_ST_PENDING;
                                if (! emu->timer_active) {
-                                       emu->tlist.expires = jiffies + 1;
-                                       add_timer(&emu->tlist);
+                                       mod_timer(&emu->tlist, jiffies + 1);
                                        emu->timer_active = 1;
                                }
                        } else
@@ -223,8 +222,7 @@ void snd_emux_timer_callback(unsigned long data)
                }
        }
        if (do_again) {
-               emu->tlist.expires = jiffies + 1;
-               add_timer(&emu->tlist);
+               mod_timer(&emu->tlist, jiffies + 1);
                emu->timer_active = 1;
        } else
                emu->timer_active = 0;