Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc47ba90 authored by Kees Cook's avatar Kees Cook Committed by Takashi Iwai
Browse files

ALSA: drivers: Convert timers to use timer_setup()



In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 1a019015
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -529,9 +529,9 @@ static unsigned int loopback_pos_update(struct loopback_cable *cable)
	return running;
}

static void loopback_timer_function(unsigned long data)
static void loopback_timer_function(struct timer_list *t)
{
	struct loopback_pcm *dpcm = (struct loopback_pcm *)data;
	struct loopback_pcm *dpcm = from_timer(dpcm, t, timer);
	unsigned long flags;

	spin_lock_irqsave(&dpcm->cable->lock, flags);
@@ -675,8 +675,7 @@ static int loopback_open(struct snd_pcm_substream *substream)
	}
	dpcm->loopback = loopback;
	dpcm->substream = substream;
	setup_timer(&dpcm->timer, loopback_timer_function,
		    (unsigned long)dpcm);
	timer_setup(&dpcm->timer, loopback_timer_function, 0);

	cable = loopback->cables[substream->number][dev];
	if (!cable) {
+3 −4
Original line number Diff line number Diff line
@@ -306,9 +306,9 @@ static int dummy_systimer_prepare(struct snd_pcm_substream *substream)
	return 0;
}

static void dummy_systimer_callback(unsigned long data)
static void dummy_systimer_callback(struct timer_list *t)
{
	struct dummy_systimer_pcm *dpcm = (struct dummy_systimer_pcm *)data;
	struct dummy_systimer_pcm *dpcm = from_timer(dpcm, t, timer);
	unsigned long flags;
	int elapsed = 0;
	
@@ -343,8 +343,7 @@ static int dummy_systimer_create(struct snd_pcm_substream *substream)
	if (!dpcm)
		return -ENOMEM;
	substream->runtime->private_data = dpcm;
	setup_timer(&dpcm->timer, dummy_systimer_callback,
			(unsigned long) dpcm);
	timer_setup(&dpcm->timer, dummy_systimer_callback, 0);
	spin_lock_init(&dpcm->lock);
	dpcm->substream = substream;
	return 0;
+3 −4
Original line number Diff line number Diff line
@@ -169,9 +169,9 @@ EXPORT_SYMBOL(snd_mpu401_uart_interrupt_tx);
 * timer callback
 * reprogram the timer and call the interrupt job
 */
static void snd_mpu401_uart_timer(unsigned long data)
static void snd_mpu401_uart_timer(struct timer_list *t)
{
	struct snd_mpu401 *mpu = (struct snd_mpu401 *)data;
	struct snd_mpu401 *mpu = from_timer(mpu, t, timer);
	unsigned long flags;

	spin_lock_irqsave(&mpu->timer_lock, flags);
@@ -191,8 +191,7 @@ 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) {
		setup_timer(&mpu->timer, snd_mpu401_uart_timer,
			    (unsigned long)mpu);
		timer_setup(&mpu->timer, snd_mpu401_uart_timer, 0);
		mod_timer(&mpu->timer, 1 + jiffies);
	} 
	mpu->timer_invoked |= input ? MPU401_MODE_INPUT_TIMER :
+3 −4
Original line number Diff line number Diff line
@@ -406,10 +406,10 @@ static void snd_mtpav_input_trigger(struct snd_rawmidi_substream *substream, int
 * timer interrupt for outputs
 */

static void snd_mtpav_output_timer(unsigned long data)
static void snd_mtpav_output_timer(struct timer_list *t)
{
	unsigned long flags;
	struct mtpav *chip = (struct mtpav *)data;
	struct mtpav *chip = from_timer(chip, t, timer);
	int p;

	spin_lock_irqsave(&chip->spinlock, flags);
@@ -707,8 +707,7 @@ static int snd_mtpav_probe(struct platform_device *dev)
	mtp_card->share_irq = 0;
	mtp_card->inmidistate = 0;
	mtp_card->outmidihwport = 0xffffffff;
	setup_timer(&mtp_card->timer, snd_mtpav_output_timer,
		    (unsigned long) mtp_card);
	timer_setup(&mtp_card->timer, snd_mtpav_output_timer, 0);

	card->private_free = snd_mtpav_free;

+2 −2
Original line number Diff line number Diff line
@@ -238,10 +238,10 @@ static int opl3_get_voice(struct snd_opl3 *opl3, int instr_4op,
/*
 * System timer interrupt function
 */
void snd_opl3_timer_func(unsigned long data)
void snd_opl3_timer_func(struct timer_list *t)
{

	struct snd_opl3 *opl3 = (struct snd_opl3 *)data;
	struct snd_opl3 *opl3 = from_timer(opl3, t, tlist);
	unsigned long flags;
	int again = 0;
	int i;
Loading