aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-20 03:40:20 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-28 01:19:47 -0500
commit6dd1c05cd7c26a463bbcca1ab50b59b86d88de64 (patch)
tree29e2fe0f3fdc81594c981580b0d0798d2cf8ee72 /sound/usb
parent8a3b7c086a509d90c312ebab6d8e5a9bf48c6cf5 (diff)
ALSA: line6/toneport: Move setup_timer() at the beginning
... so that timer_del_sync() in the destructor can be called safely at any time. Also move the mod_timer() call in toneport_setup(), which is a bit clearer place. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/line6/toneport.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/usb/line6/toneport.c b/sound/usb/line6/toneport.c
index e5669bd3233a..fb6d5e1e2ade 100644
--- a/sound/usb/line6/toneport.c
+++ b/sound/usb/line6/toneport.c
@@ -360,6 +360,8 @@ static void toneport_setup(struct usb_line6_toneport *toneport)
360 360
361 if (toneport_has_led(toneport->type)) 361 if (toneport_has_led(toneport->type))
362 toneport_update_led(&usbdev->dev); 362 toneport_update_led(&usbdev->dev);
363
364 mod_timer(&toneport->timer, jiffies + TONEPORT_PCM_DELAY * HZ);
363} 365}
364 366
365/* 367/*
@@ -390,6 +392,9 @@ static int toneport_init(struct usb_interface *interface,
390 int err; 392 int err;
391 struct usb_line6_toneport *toneport = (struct usb_line6_toneport *) line6; 393 struct usb_line6_toneport *toneport = (struct usb_line6_toneport *) line6;
392 394
395 setup_timer(&toneport->timer, toneport_start_pcm,
396 (unsigned long)toneport);
397
393 line6->disconnect = line6_toneport_disconnect; 398 line6->disconnect = line6_toneport_disconnect;
394 399
395 /* initialize PCM subsystem: */ 400 /* initialize PCM subsystem: */
@@ -435,10 +440,6 @@ static int toneport_init(struct usb_interface *interface,
435 440
436 toneport_setup(toneport); 441 toneport_setup(toneport);
437 442
438 setup_timer(&toneport->timer, toneport_start_pcm,
439 (unsigned long)toneport);
440 mod_timer(&toneport->timer, jiffies + TONEPORT_PCM_DELAY * HZ);
441
442 /* register audio system: */ 443 /* register audio system: */
443 return snd_card_register(line6->card); 444 return snd_card_register(line6->card);
444} 445}