diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-19 05:28:13 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-19 05:28:13 -0500 |
commit | b093ed23dad894d473bb2e9948facf7fc509ae77 (patch) | |
tree | 59ce32522532059e5048ce7a003665bf89e54451 | |
parent | db974553e368f0c2caef004b775569e898541c15 (diff) |
ALSA: mpu401: Use setup_timer() and mod_timer()
No functional change, refactoring with the standard helpers.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/drivers/mpu401/mpu401_uart.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c index e3a90d043f03..1e19eb9e1596 100644 --- a/sound/drivers/mpu401/mpu401_uart.c +++ b/sound/drivers/mpu401/mpu401_uart.c | |||
@@ -176,8 +176,7 @@ static void snd_mpu401_uart_timer(unsigned long data) | |||
176 | 176 | ||
177 | spin_lock_irqsave(&mpu->timer_lock, flags); | 177 | spin_lock_irqsave(&mpu->timer_lock, flags); |
178 | /*mpu->mode |= MPU401_MODE_TIMER;*/ | 178 | /*mpu->mode |= MPU401_MODE_TIMER;*/ |
179 | mpu->timer.expires = 1 + jiffies; | 179 | mod_timer(&mpu->timer, 1 + jiffies); |
180 | add_timer(&mpu->timer); | ||
181 | spin_unlock_irqrestore(&mpu->timer_lock, flags); | 180 | spin_unlock_irqrestore(&mpu->timer_lock, flags); |
182 | if (mpu->rmidi) | 181 | if (mpu->rmidi) |
183 | _snd_mpu401_uart_interrupt(mpu); | 182 | _snd_mpu401_uart_interrupt(mpu); |
@@ -192,11 +191,9 @@ static void snd_mpu401_uart_add_timer (struct snd_mpu401 *mpu, int input) | |||
192 | 191 | ||
193 | spin_lock_irqsave (&mpu->timer_lock, flags); | 192 | spin_lock_irqsave (&mpu->timer_lock, flags); |
194 | if (mpu->timer_invoked == 0) { | 193 | if (mpu->timer_invoked == 0) { |
195 | init_timer(&mpu->timer); | 194 | setup_timer(&mpu->timer, snd_mpu401_uart_timer, |
196 | mpu->timer.data = (unsigned long)mpu; | 195 | (unsigned long)mpu); |
197 | mpu->timer.function = snd_mpu401_uart_timer; | 196 | mod_timer(&mpu->timer, 1 + jiffies); |
198 | mpu->timer.expires = 1 + jiffies; | ||
199 | add_timer(&mpu->timer); | ||
200 | } | 197 | } |
201 | mpu->timer_invoked |= input ? MPU401_MODE_INPUT_TIMER : | 198 | mpu->timer_invoked |= input ? MPU401_MODE_INPUT_TIMER : |
202 | MPU401_MODE_OUTPUT_TIMER; | 199 | MPU401_MODE_OUTPUT_TIMER; |