Use setup_timer() and mod_timer()
Subsystems (2)
cover Use setup_timer() and mod_timer()
Hi,
this is a series of simple cleanup patches to replace the open codes with the standard helpers, setup_timer() and mod_timer().
Takashi
PATCH 1/18 ALSA: timer: Use setup_timer() and mod_timer()
No functional change, refactoring with the standard helpers.
--- sound/core/timer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/core/timer.c +1 -3
@@ -1030,9 +1030,7 @@ static int snd_timer_register_system(void)snd_timer_free (timer);return -ENOMEM ; } -init_timer (&priv->tlist); - priv->tlist.function = snd_timer_s_function; - priv->tlist.data = (unsigned long ) timer; +setup_timer (&priv->tlist, snd_timer_s_function, (unsigned long ) timer); timer->private_data = priv; timer->private_free = snd_timer_free_system;return snd_timer_global_register (timer);
Signature · 1 line
2.2.1
PATCH 2/18 ALSA: aloop: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/drivers/aloop.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/drivers/aloop.c +1 -2
@@ -181,8 +181,7 @@ static void loopback_timer_start(struct loopback_pcm *dpcm) } tick = dpcm->period_size_frac - dpcm->irq_pos; tick = (tick + dpcm->pcm_bps -1 ) / dpcm->pcm_bps; - dpcm->timer.expires = jiffies + tick; -add_timer (&dpcm->timer); +mod_timer (&dpcm->timer, jiffies + tick); }/* call in cable->lock */
Signature · 1 line
2.2.1
PATCH 3/18 ALSA: mpu401: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/drivers/mpu401/mpu401_uart.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
sound/drivers/mpu401/mpu401_uart.c +4 -7
@@ -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);
@@ -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 ;
Signature · 1 line
2.2.1
PATCH 4/18 ALSA: mtpav: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/drivers/mtpav.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
sound/drivers/mtpav.c +4 -8
@@ -414,8 +414,7 @@ static void snd_mtpav_output_timer(unsigned long data)spin_lock_irqsave (&chip->spinlock, flags);/* reprogram timer */ - chip->timer.expires =1 + jiffies; -add_timer (&chip->timer); +mod_timer (&chip->timer,1 + jiffies);/* process each port */ for (p =0 ; p <= chip->num_ports *2 +MTPAV_PIDX_BROADCAST ; p++) {struct mtpav_port *portp = &chip->ports[p];
@@ -428,8 +427,7 @@ static void snd_mtpav_output_timer(unsigned long data)/* spinlock held! */ static void snd_mtpav_add_output_timer (struct mtpav *chip) { - chip->timer.expires =1 + jiffies; -add_timer (&chip->timer); +mod_timer (&chip->timer,1 + jiffies); }/* spinlock held! */
@@ -704,15 +702,13 @@ static int snd_mtpav_probe(struct platform_device *dev) mtp_card = card->private_data;spin_lock_init (&mtp_card->spinlock); -init_timer (&mtp_card->timer); mtp_card->card = card; mtp_card->irq =-1 ; mtp_card->share_irq =0 ; mtp_card->inmidistate =0 ; mtp_card->outmidihwport =0xffffffff ; -init_timer (&mtp_card->timer); - mtp_card->timer.function = snd_mtpav_output_timer; - mtp_card->timer.data = (unsigned long ) mtp_card; +setup_timer (&mtp_card->timer, snd_mtpav_output_timer, + (unsigned long ) mtp_card); card->private_free = snd_mtpav_free;
Signature · 1 line
2.2.1
PATCH 5/18 ALSA: opl3: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/drivers/opl3/opl3_midi.c | 11 ++++------- sound/drivers/opl3/opl3_seq.c | 4 +--- 2 files changed, 5 insertions(+), 10 deletions(-)
sound/drivers/opl3/opl3_midi.c +4 -7
@@ -258,12 +258,10 @@ void snd_opl3_timer_func(unsigned long data)spin_unlock_irqrestore (&opl3->voice_lock, flags);spin_lock_irqsave (&opl3->sys_timer_lock, flags); -if (again) { - opl3->tlist.expires = jiffies +1 ;/* invoke again */ -add_timer (&opl3->tlist); - }else { +if (again) +mod_timer (&opl3->tlist, jiffies +1 );/* invoke again */ +else opl3->sys_timer_status =0 ; - }spin_unlock_irqrestore (&opl3->sys_timer_lock, flags); }
@@ -275,8 +273,7 @@ static void snd_opl3_start_timer(struct snd_opl3 *opl3)unsigned long flags;spin_lock_irqsave (&opl3->sys_timer_lock, flags);if (! opl3->sys_timer_status) { - opl3->tlist.expires = jiffies +1 ; -add_timer (&opl3->tlist); +mod_timer (&opl3->tlist, jiffies +1 ); opl3->sys_timer_status =1 ; }spin_unlock_irqrestore (&opl3->sys_timer_lock, flags);
sound/drivers/opl3/opl3_seq.c +1 -3
@@ -247,9 +247,7 @@ static int snd_opl3_seq_new_device(struct snd_seq_device *dev) }/* setup system timer */ -init_timer (&opl3->tlist); - opl3->tlist.function = snd_opl3_timer_func; - opl3->tlist.data = (unsigned long ) opl3; +setup_timer (&opl3->tlist, snd_opl3_timer_func, (unsigned long ) opl3);spin_lock_init (&opl3->sys_timer_lock); opl3->sys_timer_status =0 ;
Signature · 1 line
2.2.1
PATCH 6/18 ALSA: serial-u16550: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/drivers/serial-u16550.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
sound/drivers/serial-u16550.c +3 -5
@@ -174,9 +174,8 @@ static inline void snd_uart16550_add_timer(struct snd_uart16550 *uart) {if (!uart->timer_running) {/* timer 38600bps * 10bit * 16byte */ - uart->buffer_timer.expires = jiffies + (HZ +255 )/256 ; +mod_timer (&uart->buffer_timer, jiffies + (HZ +255 ) /256 ); uart->timer_running =1 ; -add_timer (&uart->buffer_timer); } }
@@ -830,9 +829,8 @@ static int snd_uart16550_create(struct snd_card *card, uart->prev_in =0 ; uart->rstatus =0 ;memset (uart->prev_status,0x80 ,sizeof (unsigned char ) *SNDRV_SERIAL_MAX_OUTS ); -init_timer (&uart->buffer_timer); - uart->buffer_timer.function = snd_uart16550_buffer_timer; - uart->buffer_timer.data = (unsigned long )uart; +setup_timer (&uart->buffer_timer, snd_uart16550_buffer_timer, + (unsigned long )uart); uart->timer_running =0 ;/* Register device */
Signature · 1 line
2.2.1
PATCH 7/18 ALSA: ak4117: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/i2c/other/ak4117.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
sound/i2c/other/ak4117.c +3 -7
@@ -91,9 +91,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t chip->read = read; chip->write = write; chip->private_data = private_data; -init_timer (&chip->timer); - chip->timer.data = (unsigned long )chip; - chip->timer.function = snd_ak4117_timer; +setup_timer (&chip->timer, snd_ak4117_timer, (unsigned long )chip);for (reg =0 ; reg <5 ; reg++) chip->regmap[reg] = pgm[reg];
@@ -139,8 +137,7 @@ void snd_ak4117_reinit(struct ak4117 *chip)/* release powerdown, everything is initialized now */ reg_write (chip,AK4117_REG_PWRDN , old |AK4117_RST |AK4117_PWN ); chip->init =0 ; - chip->timer.expires =1 + jiffies; -add_timer (&chip->timer); +mod_timer (&chip->timer,1 + jiffies); }static unsigned int external_rate (unsigned char rcs1)
@@ -540,8 +537,7 @@ static void snd_ak4117_timer(unsigned long data)if (chip->init)return ;snd_ak4117_check_rate_and_errors (chip,0 ); - chip->timer.expires =1 + jiffies; -add_timer (&chip->timer); +mod_timer (&chip->timer,1 + jiffies); }EXPORT_SYMBOL (snd_ak4117_create);
Signature · 1 line
2.2.1
PATCH 8/18 ALSA: sb: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/isa/sb/emu8000_pcm.c | 10 +++------- sound/isa/sb/sb8_midi.c | 12 +++++------- 2 files changed, 8 insertions(+), 14 deletions(-)
sound/isa/sb/emu8000_pcm.c +3 -7
@@ -207,8 +207,7 @@ static void emu8k_pcm_timer_func(unsigned long data) rec->last_ptr = ptr;/* reprogram timer */ - rec->timer.expires = jiffies +1 ; -add_timer (&rec->timer); +mod_timer (&rec->timer, jiffies +1 );/* update period */ if (rec->period_pos >= (int )rec->period_size) {
@@ -240,9 +239,7 @@ static int emu8k_pcm_open(struct snd_pcm_substream *subs) runtime->private_data = rec;spin_lock_init (&rec->timer_lock); -init_timer (&rec->timer); - rec->timer.function = emu8k_pcm_timer_func; - rec->timer.data = (unsigned long )rec; +setup_timer (&rec->timer, emu8k_pcm_timer_func, (unsigned long )rec); runtime->hw = emu8k_pcm_hw; runtime->hw.buffer_bytes_max = emu->mem_size -LOOP_BLANK_SIZE *3 ;
@@ -359,8 +356,7 @@ static void start_voice(struct snd_emu8k_pcm *rec, int ch)/* start timer */ spin_lock_irqsave (&rec->timer_lock, flags);if (! rec->timer_running) { - rec->timer.expires = jiffies +1 ; -add_timer (&rec->timer); +mod_timer (&rec->timer, jiffies +1 ); rec->timer_running =1 ; }spin_unlock_irqrestore (&rec->timer_lock, flags);
sound/isa/sb/sb8_midi.c +5 -7
@@ -216,8 +216,7 @@ static void snd_sb8dsp_midi_output_timer(unsigned long data)unsigned long flags;spin_lock_irqsave (&chip->open_lock, flags); - chip->midi_timer.expires =1 + jiffies; -add_timer (&chip->midi_timer); +mod_timer (&chip->midi_timer,1 + jiffies);spin_unlock_irqrestore (&chip->open_lock, flags);snd_sb8dsp_midi_output_write (substream); }
@@ -231,11 +230,10 @@ static void snd_sb8dsp_midi_output_trigger(struct snd_rawmidi_substream *substrespin_lock_irqsave (&chip->open_lock, flags);if (up) {if (!(chip->open &SB_OPEN_MIDI_OUTPUT_TRIGGER )) { -init_timer (&chip->midi_timer); - chip->midi_timer.function = snd_sb8dsp_midi_output_timer; - chip->midi_timer.data = (unsigned long ) substream; - chip->midi_timer.expires =1 + jiffies; -add_timer (&chip->midi_timer); +setup_timer (&chip->midi_timer, + snd_sb8dsp_midi_output_timer, + (unsigned long ) substream); +mod_timer (&chip->midi_timer,1 + jiffies); chip->open |=SB_OPEN_MIDI_OUTPUT_TRIGGER ; } }else {
Signature · 1 line
2.2.1
PATCH 9/18 ALSA: wavefront: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/isa/wavefront/wavefront_midi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
sound/isa/wavefront/wavefront_midi.c +5 -7
@@ -356,8 +356,7 @@ static void snd_wavefront_midi_output_timer(unsigned long data)unsigned long flags;spin_lock_irqsave (&midi->virtual, flags); - midi->timer.expires =1 + jiffies; -add_timer (&midi->timer); +mod_timer (&midi->timer,1 + jiffies);spin_unlock_irqrestore (&midi->virtual, flags);snd_wavefront_midi_output_write (card); }
@@ -384,11 +383,10 @@ static void snd_wavefront_midi_output_trigger(struct snd_rawmidi_substream *subsif (up) {if ((midi->mode[mpu] &MPU401_MODE_OUTPUT_TRIGGER ) ==0 ) {if (!midi->istimer) { -init_timer (&midi->timer); - midi->timer.function = snd_wavefront_midi_output_timer; - midi->timer.data = (unsigned long ) substream->rmidi->card->private_data; - midi->timer.expires =1 + jiffies; -add_timer (&midi->timer); +setup_timer (&midi->timer, + snd_wavefront_midi_output_timer, + (unsigned long ) substream->rmidi->card->private_data); +mod_timer (&midi->timer,1 + jiffies); } midi->istimer++; midi->mode[mpu] |=MPU401_MODE_OUTPUT_TRIGGER ;
Signature · 1 line
2.2.1
PATCH 10/18 ALSA: asihpi: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/pci/asihpi/asihpi.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
sound/pci/asihpi/asihpi.c +5 -8
@@ -540,9 +540,8 @@ static void snd_card_asihpi_pcm_timer_start(struct snd_pcm_substream * expiry =HZ /200 ; expiry =max (expiry,1 );/* don't let it be zero! */ - dpcm->timer.expires = jiffies + expiry; +mod_timer (&dpcm->timer, jiffies + expiry); dpcm->respawn_timer =1 ; -add_timer (&dpcm->timer); }static void snd_card_asihpi_pcm_timer_stop (struct snd_pcm_substream *substream)
@@ -1064,9 +1063,8 @@ static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream)If internal and other stream playing, can't switch */ -init_timer (&dpcm->timer); - dpcm->timer.data = (unsigned long ) dpcm; - dpcm->timer.function = snd_card_asihpi_timer_function; +setup_timer (&dpcm->timer, snd_card_asihpi_timer_function, + (unsigned long ) dpcm); dpcm->substream = substream; runtime->private_data = dpcm; runtime->private_free = snd_card_asihpi_runtime_free;
@@ -1246,9 +1244,8 @@ static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream)if (err)return -EIO ; -init_timer (&dpcm->timer); - dpcm->timer.data = (unsigned long ) dpcm; - dpcm->timer.function = snd_card_asihpi_timer_function; +setup_timer (&dpcm->timer, snd_card_asihpi_timer_function, + (unsigned long ) dpcm); dpcm->substream = substream; runtime->private_data = dpcm; runtime->private_free = snd_card_asihpi_runtime_free;
Signature · 1 line
2.2.1
PATCH 11/18 ALSA: echoaudio: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/pci/echoaudio/midi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
sound/pci/echoaudio/midi.c +2 -3
@@ -257,9 +257,8 @@ static void snd_echo_midi_output_trigger(struct snd_rawmidi_substream *substreamspin_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 {
Signature · 1 line
2.2.1
PATCH 12/18 ALSA: korg1212: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/pci/korg1212/korg1212.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
sound/pci/korg1212/korg1212.c +4 -7
@@ -585,8 +585,7 @@ static void snd_korg1212_SendStop(struct snd_korg1212 *korg1212) korg1212->sharedBufferPtr->cardCommand =0xffffffff ;/* program the timer */ korg1212->stop_pending_cnt =HZ ; - korg1212->timer.expires = jiffies +1 ; -add_timer (&korg1212->timer); +mod_timer (&korg1212->timer, jiffies +1 ); } }
@@ -617,8 +616,7 @@ static void snd_korg1212_timer_func(unsigned long data) }else {if (--korg1212->stop_pending_cnt >0 ) {/* reprogram timer */ - korg1212->timer.expires = jiffies +1 ; -add_timer (&korg1212->timer); +mod_timer (&korg1212->timer, jiffies +1 ); }else {snd_printd ("korg1212_timer_func timeout\n" ); korg1212->sharedBufferPtr->cardCommand =0 ;
@@ -2172,9 +2170,8 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci,init_waitqueue_head (&korg1212->wait);spin_lock_init (&korg1212->lock);mutex_init (&korg1212->open_mutex); -init_timer (&korg1212->timer); - korg1212->timer.function = snd_korg1212_timer_func; - korg1212->timer.data = (unsigned long )korg1212; +setup_timer (&korg1212->timer, snd_korg1212_timer_func, + (unsigned long )korg1212); korg1212->irq =-1 ; korg1212->clkSource = K1212_CLKIDX_Local;
Signature · 1 line
2.2.1
PATCH 13/18 ALSA: hdsp: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/pci/rme9652/hdsp.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
sound/pci/rme9652/hdsp.c +5 -9
@@ -1428,10 +1428,8 @@ static void snd_hdsp_midi_output_timer(unsigned long data)leaving istimer wherever it was set before. */ -if (hmidi->istimer) { - hmidi->timer.expires =1 + jiffies; -add_timer (&hmidi->timer); - } +if (hmidi->istimer) +mod_timer (&hmidi->timer,1 + jiffies);spin_unlock_irqrestore (&hmidi->lock, flags); }
@@ -1445,11 +1443,9 @@ static void snd_hdsp_midi_output_trigger(struct snd_rawmidi_substream *substreamspin_lock_irqsave (&hmidi->lock, flags);if (up) {if (!hmidi->istimer) { -init_timer (&hmidi->timer); - hmidi->timer.function = snd_hdsp_midi_output_timer; - hmidi->timer.data = (unsigned long ) hmidi; - hmidi->timer.expires =1 + jiffies; -add_timer (&hmidi->timer); +setup_timer (&hmidi->timer, snd_hdsp_midi_output_timer, + (unsigned long ) hmidi); +mod_timer (&hmidi->timer,1 + jiffies); hmidi->istimer++; } }else {
Signature · 1 line
2.2.1
PATCH 14/18 ALSA: hdspm: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/pci/rme9652/hdspm.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
sound/pci/rme9652/hdspm.c +5 -9
@@ -1957,10 +1957,8 @@ static void snd_hdspm_midi_output_timer(unsigned long data)leaving istimer wherever it was set before. */ -if (hmidi->istimer) { - hmidi->timer.expires =1 + jiffies; -add_timer (&hmidi->timer); - } +if (hmidi->istimer) +mod_timer (&hmidi->timer,1 + jiffies);spin_unlock_irqrestore (&hmidi->lock, flags); }
@@ -1975,11 +1973,9 @@ snd_hdspm_midi_output_trigger(struct snd_rawmidi_substream *substream, int up)spin_lock_irqsave (&hmidi->lock, flags);if (up) {if (!hmidi->istimer) { -init_timer (&hmidi->timer); - hmidi->timer.function = snd_hdspm_midi_output_timer; - hmidi->timer.data = (unsigned long ) hmidi; - hmidi->timer.expires =1 + jiffies; -add_timer (&hmidi->timer); +setup_timer (&hmidi->timer, snd_hdspm_midi_output_timer, + (unsigned long ) hmidi); +mod_timer (&hmidi->timer,1 + jiffies); hmidi->istimer++; } }else {
Signature · 1 line
2.2.1
PATCH 15/18 ALSA: aica: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/sh/aica.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
sound/sh/aica.c +3 -5
@@ -343,11 +343,9 @@ static void spu_begin_dma(struct snd_pcm_substream *substream)mod_timer (&dreamcastcard->timer, jiffies +4 );return ; } -init_timer (&(dreamcastcard->timer)); - dreamcastcard->timer.data = (unsigned long ) substream; - dreamcastcard->timer.function = aica_period_elapsed; - dreamcastcard->timer.expires = jiffies +4 ; -add_timer (&(dreamcastcard->timer)); +setup_timer (&dreamcastcard->timer, aica_period_elapsed, + (unsigned long ) substream); +mod_timer (&dreamcastcard->timer, jiffies +4 ); } static int snd_aicapcm_pcm_open(struct snd_pcm_substream
Signature · 1 line
2.2.1
PATCH 16/18 ALSA: emux: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/synth/emux/emux.c | 4 +--- sound/synth/emux/emux_synth.c | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-)
sound/synth/emux/emux.c +1 -3
@@ -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;
sound/synth/emux/emux_synth.c +2 -4
@@ -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 ;
Signature · 1 line
2.2.1
PATCH 17/18 ALSA: usb-audio: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/usb/midi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
sound/usb/midi.c +2 -3
@@ -2292,14 +2292,13 @@ int snd_usbmidi_create(struct snd_card *card, umidi->iface = iface; umidi->quirk = quirk; umidi->usb_protocol_ops = &snd_usbmidi_standard_ops; -init_timer (&umidi->error_timer);spin_lock_init (&umidi->disc_lock);init_rwsem (&umidi->disc_rwsem);mutex_init (&umidi->mutex); umidi->usb_id =USB_ID (le16_to_cpu (umidi->dev->descriptor.idVendor),le16_to_cpu (umidi->dev->descriptor.idProduct)); - umidi->error_timer.function = snd_usbmidi_error_timer; - umidi->error_timer.data = (unsigned long )umidi; +setup_timer (&umidi->error_timer, snd_usbmidi_error_timer, + (unsigned long )umidi);/* detect the endpoint(s) to use */ memset (endpoints,0 ,sizeof (endpoints));
Signature · 1 line
2.2.1
PATCH 18/18 ALSA: line6: Use setup_timer() and mod_timer()
In reply to Takashi IwaiNo functional change, refactoring with the standard helpers.
--- sound/usb/line6/driver.c | 3 +-- sound/usb/line6/toneport.c | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-)
sound/usb/line6/driver.c +1 -2
@@ -415,8 +415,7 @@ void line6_start_timer(struct timer_list *timer, unsigned int msecs, void (*function)(unsigned long), unsigned long data) {setup_timer (timer ,function ,data ); - timer->expires = jiffies + msecs *HZ /1000 ; -add_timer (timer); +mod_timer (timer, jiffies + msecs *HZ /1000 ); }/*
sound/usb/line6/toneport.c +3 -5
@@ -433,11 +433,9 @@ static int toneport_try_init(struct usb_interface *interface,toneport_setup (toneport); -init_timer (&toneport->timer); - toneport->timer.expires = jiffies +TONEPORT_PCM_DELAY *HZ ; - toneport->timer.function = toneport_start_pcm; - toneport->timer.data = (unsigned long )toneport; -add_timer (&toneport->timer); +setup_timer (&toneport->timer, toneport_start_pcm, + (unsigned long )toneport); +mod_timer (&toneport->timer, jiffies +TONEPORT_PCM_DELAY *HZ );return 0 ; }
Signature · 1 line
2.2.1