diff options
Diffstat (limited to 'sound/core/timer.c')
-rw-r--r-- | sound/core/timer.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c index aa1b15c155d1..6469bedda2f3 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c | |||
@@ -1019,8 +1019,8 @@ static int snd_timer_s_start(struct snd_timer * timer) | |||
1019 | njiff += timer->sticks - priv->correction; | 1019 | njiff += timer->sticks - priv->correction; |
1020 | priv->correction = 0; | 1020 | priv->correction = 0; |
1021 | } | 1021 | } |
1022 | priv->last_expires = priv->tlist.expires = njiff; | 1022 | priv->last_expires = njiff; |
1023 | add_timer(&priv->tlist); | 1023 | mod_timer(&priv->tlist, njiff); |
1024 | return 0; | 1024 | return 0; |
1025 | } | 1025 | } |
1026 | 1026 | ||
@@ -1502,17 +1502,13 @@ static int snd_timer_user_ginfo(struct file *file, | |||
1502 | return err; | 1502 | return err; |
1503 | } | 1503 | } |
1504 | 1504 | ||
1505 | static int snd_timer_user_gparams(struct file *file, | 1505 | static int timer_set_gparams(struct snd_timer_gparams *gparams) |
1506 | struct snd_timer_gparams __user *_gparams) | ||
1507 | { | 1506 | { |
1508 | struct snd_timer_gparams gparams; | ||
1509 | struct snd_timer *t; | 1507 | struct snd_timer *t; |
1510 | int err; | 1508 | int err; |
1511 | 1509 | ||
1512 | if (copy_from_user(&gparams, _gparams, sizeof(gparams))) | ||
1513 | return -EFAULT; | ||
1514 | mutex_lock(®ister_mutex); | 1510 | mutex_lock(®ister_mutex); |
1515 | t = snd_timer_find(&gparams.tid); | 1511 | t = snd_timer_find(&gparams->tid); |
1516 | if (!t) { | 1512 | if (!t) { |
1517 | err = -ENODEV; | 1513 | err = -ENODEV; |
1518 | goto _error; | 1514 | goto _error; |
@@ -1525,12 +1521,22 @@ static int snd_timer_user_gparams(struct file *file, | |||
1525 | err = -ENOSYS; | 1521 | err = -ENOSYS; |
1526 | goto _error; | 1522 | goto _error; |
1527 | } | 1523 | } |
1528 | err = t->hw.set_period(t, gparams.period_num, gparams.period_den); | 1524 | err = t->hw.set_period(t, gparams->period_num, gparams->period_den); |
1529 | _error: | 1525 | _error: |
1530 | mutex_unlock(®ister_mutex); | 1526 | mutex_unlock(®ister_mutex); |
1531 | return err; | 1527 | return err; |
1532 | } | 1528 | } |
1533 | 1529 | ||
1530 | static int snd_timer_user_gparams(struct file *file, | ||
1531 | struct snd_timer_gparams __user *_gparams) | ||
1532 | { | ||
1533 | struct snd_timer_gparams gparams; | ||
1534 | |||
1535 | if (copy_from_user(&gparams, _gparams, sizeof(gparams))) | ||
1536 | return -EFAULT; | ||
1537 | return timer_set_gparams(&gparams); | ||
1538 | } | ||
1539 | |||
1534 | static int snd_timer_user_gstatus(struct file *file, | 1540 | static int snd_timer_user_gstatus(struct file *file, |
1535 | struct snd_timer_gstatus __user *_gstatus) | 1541 | struct snd_timer_gstatus __user *_gstatus) |
1536 | { | 1542 | { |