Skip to content

Commit

Permalink
ALSA: mpu401: Use setup_timer() and mod_timer()
Browse files Browse the repository at this point in the history
No functional change, refactoring with the standard helpers.

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jan 19, 2015
1 parent db97455 commit b093ed2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions sound/drivers/mpu401/mpu401_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ static void snd_mpu401_uart_timer(unsigned long data)

spin_lock_irqsave(&mpu->timer_lock, flags);
/*mpu->mode |= MPU401_MODE_TIMER;*/
mpu->timer.expires = 1 + jiffies;
add_timer(&mpu->timer);
mod_timer(&mpu->timer, 1 + jiffies);
spin_unlock_irqrestore(&mpu->timer_lock, flags);
if (mpu->rmidi)
_snd_mpu401_uart_interrupt(mpu);
Expand All @@ -192,11 +191,9 @@ static void snd_mpu401_uart_add_timer (struct snd_mpu401 *mpu, int input)

spin_lock_irqsave (&mpu->timer_lock, flags);
if (mpu->timer_invoked == 0) {
init_timer(&mpu->timer);
mpu->timer.data = (unsigned long)mpu;
mpu->timer.function = snd_mpu401_uart_timer;
mpu->timer.expires = 1 + jiffies;
add_timer(&mpu->timer);
setup_timer(&mpu->timer, snd_mpu401_uart_timer,
(unsigned long)mpu);
mod_timer(&mpu->timer, 1 + jiffies);
}
mpu->timer_invoked |= input ? MPU401_MODE_INPUT_TIMER :
MPU401_MODE_OUTPUT_TIMER;
Expand Down

0 comments on commit b093ed2

Please sign in to comment.