summaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-04-14 21:08:30 +0000
committerThomas Gleixner <tglx@linutronix.de>2015-04-22 17:06:48 +0200
commit447fbbdc2cd58cdaf410fefef365a9ce38833157 (patch)
tree3963eb5fa9e503e924b8ff142b19d017c9daead8 /sound/core
parent1e3176885cce8e0137d6f4072c5910bfa00901ed (diff)
sound: Use hrtimer_resolution instead of hrtimer_get_res()
No point in converting a timespec now that the value is directly accessible. Get rid of the null check while at it. Resolution is guaranteed to be > 0. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Peter Zijlstra <peterz@infradead.org> Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com> Cc: Viresh Kumar <viresh.kumar@linaro.org> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: alsa-devel@alsa-project.org Link: http://lkml.kernel.org/r/20150414203500.799133359@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/hrtimer.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/sound/core/hrtimer.c b/sound/core/hrtimer.c
index 886be7da989d..f845ecf7e172 100644
--- a/sound/core/hrtimer.c
+++ b/sound/core/hrtimer.c
@@ -121,16 +121,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,