ALSA: mpu401: Use setup_timer() and mod_timer()
No functional change, refactoring with the standard helpers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
db974553e3
commit
b093ed23da
|
@ -176,8 +176,7 @@ static void snd_mpu401_uart_timer(unsigned long data)
|
||||||
|
|
||||||
spin_lock_irqsave(&mpu->timer_lock, flags);
|
spin_lock_irqsave(&mpu->timer_lock, flags);
|
||||||
/*mpu->mode |= MPU401_MODE_TIMER;*/
|
/*mpu->mode |= MPU401_MODE_TIMER;*/
|
||||||
mpu->timer.expires = 1 + jiffies;
|
mod_timer(&mpu->timer, 1 + jiffies);
|
||||||
add_timer(&mpu->timer);
|
|
||||||
spin_unlock_irqrestore(&mpu->timer_lock, flags);
|
spin_unlock_irqrestore(&mpu->timer_lock, flags);
|
||||||
if (mpu->rmidi)
|
if (mpu->rmidi)
|
||||||
_snd_mpu401_uart_interrupt(mpu);
|
_snd_mpu401_uart_interrupt(mpu);
|
||||||
|
@ -192,11 +191,9 @@ static void snd_mpu401_uart_add_timer (struct snd_mpu401 *mpu, int input)
|
||||||
|
|
||||||
spin_lock_irqsave (&mpu->timer_lock, flags);
|
spin_lock_irqsave (&mpu->timer_lock, flags);
|
||||||
if (mpu->timer_invoked == 0) {
|
if (mpu->timer_invoked == 0) {
|
||||||
init_timer(&mpu->timer);
|
setup_timer(&mpu->timer, snd_mpu401_uart_timer,
|
||||||
mpu->timer.data = (unsigned long)mpu;
|
(unsigned long)mpu);
|
||||||
mpu->timer.function = snd_mpu401_uart_timer;
|
mod_timer(&mpu->timer, 1 + jiffies);
|
||||||
mpu->timer.expires = 1 + jiffies;
|
|
||||||
add_timer(&mpu->timer);
|
|
||||||
}
|
}
|
||||||
mpu->timer_invoked |= input ? MPU401_MODE_INPUT_TIMER :
|
mpu->timer_invoked |= input ? MPU401_MODE_INPUT_TIMER :
|
||||||
MPU401_MODE_OUTPUT_TIMER;
|
MPU401_MODE_OUTPUT_TIMER;
|
||||||
|
|
Loading…
Reference in New Issue