From bc47ba90b01afe468cdd586b0dbe59b64862e2b7 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 08:34:29 -0700 Subject: 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: Kees Cook Signed-off-by: Takashi Iwai --- sound/drivers/dummy.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sound/drivers/dummy.c') diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index c0939a0164a6..7b2b1f766b00 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -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; -- cgit v1.2.3