Skip to content

Commit

Permalink
ALSA: seq: Avoid open-code for getting timer resolution
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tiwai committed May 18, 2018
1 parent fdcb576 commit 21244e3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sound/core/seq/seq_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 21244e3

Please sign in to comment.