summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-05-17 10:43:16 +0200
committerTakashi Iwai <tiwai@suse.de>2018-05-18 08:49:13 +0200
commit21244e3d6a9d36f32a2aa40f8948324c7b5f35b0 (patch)
treeecfddc3b35ba0a60d535871e003446a02532bafd /sound/core
parentALSA: timer: Simplify timer hw resolution calls (diff)
downloadlinux-21244e3d6a9d36f32a2aa40f8948324c7b5f35b0.tar.xz
linux-21244e3d6a9d36f32a2aa40f8948324c7b5f35b0.zip
ALSA: seq: Avoid open-code for getting timer resolution
Instead of open-coding for getting the timer resolution, use the standard snd_timer_resolution() helper. The original code falls back to the callback function when the resolution is zero, but it must be always so when the callback function is defined. So this should be no functional change. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/seq/seq_timer.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c
index 23167578231f..f587d0e27476 100644
--- a/sound/core/seq/seq_timer.c
+++ b/sound/core/seq/seq_timer.c
@@ -371,9 +371,7 @@ static int initialize_timer(struct snd_seq_timer *tmr)
tmr->ticks = 1;
if (!(t->hw.flags & SNDRV_TIMER_HW_SLAVE)) {
- unsigned long r = t->hw.resolution;
- if (! r && t->hw.c_resolution)
- r = t->hw.c_resolution(t);
+ unsigned long r = snd_timer_resolution(tmr->timeri);
if (r) {
tmr->ticks = (unsigned int)(1000000000uL / (r * freq));
if (! tmr->ticks)