These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / sound / core / hrtimer.c
index 886be7d..656d9a9 100644 (file)
@@ -90,7 +90,7 @@ static int snd_hrtimer_start(struct snd_timer *t)
        struct snd_hrtimer *stime = t->private_data;
 
        atomic_set(&stime->running, 0);
-       hrtimer_cancel(&stime->hrt);
+       hrtimer_try_to_cancel(&stime->hrt);
        hrtimer_start(&stime->hrt, ns_to_ktime(t->sticks * resolution),
                      HRTIMER_MODE_REL);
        atomic_set(&stime->running, 1);
@@ -101,6 +101,7 @@ static int snd_hrtimer_stop(struct snd_timer *t)
 {
        struct snd_hrtimer *stime = t->private_data;
        atomic_set(&stime->running, 0);
+       hrtimer_try_to_cancel(&stime->hrt);
        return 0;
 }
 
@@ -121,16 +122,9 @@ static struct snd_timer *mytimer;
 static int __init snd_hrtimer_init(void)
 {
        struct snd_timer *timer;
-       struct timespec tp;
        int err;
 
-       hrtimer_get_res(CLOCK_MONOTONIC, &tp);
-       if (tp.tv_sec > 0 || !tp.tv_nsec) {
-               pr_err("snd-hrtimer: Invalid resolution %u.%09u",
-                          (unsigned)tp.tv_sec, (unsigned)tp.tv_nsec);
-               return -EINVAL;
-       }
-       resolution = tp.tv_nsec;
+       resolution = hrtimer_resolution;
 
        /* Create a new timer and set up the fields */
        err = snd_timer_global_new("hrtimer", SNDRV_TIMER_GLOBAL_HRTIMER,