diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-12-29 19:41:43 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-12-30 16:41:55 +0100 |
commit | cd9978f1d3dbb9596a7ab9c652cb0d9b355489b5 (patch) | |
tree | f539b609f5adc32ddb701023170981d115feae30 /include/sound/pcm_params.h | |
parent | 89827ca9dd6173da7dcc035653bea67fa6ac0cbf (diff) | |
download | lwn-cd9978f1d3dbb9596a7ab9c652cb0d9b355489b5.tar.gz lwn-cd9978f1d3dbb9596a7ab9c652cb0d9b355489b5.zip |
ALSA: pcm: Simplify params_period_bytes()
The hw_params struct has a parameter that contains the period size in bytes.
This can be used instead of deriving the value from other parameters. This
is similar to e.g. params_buffer_bytes()
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/pcm_params.h')
-rw-r--r-- | include/sound/pcm_params.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 2e2169e4985f..042049bab0b9 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h @@ -363,9 +363,7 @@ params_subformat(const struct snd_pcm_hw_params *p) static inline unsigned int params_period_bytes(const struct snd_pcm_hw_params *p) { - return (params_period_size(p) * - snd_pcm_format_physical_width(params_format(p)) * - params_channels(p)) / 8; + return hw_param_interval_c(p, SNDRV_PCM_HW_PARAM_PERIOD_BYTES)->min; } /** |