ALSA: pcm: Use a common helper for PCM state check and hwsync
authorTakashi Iwai <tiwai@suse.de>
Fri, 19 May 2017 18:04:23 +0000 (20:04 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sun, 21 May 2017 06:57:31 +0000 (08:57 +0200)
commitf839cc1cbd29f2160ef4e621b920e254cc84133a
tree70c472a4897b282059a54f3efe4f0940cedb62e0
parentdcab5fb7a5b0472e035da7dfe21168802c1b9d3b
ALSA: pcm: Use a common helper for PCM state check and hwsync

The mostly same codes for checking the current PCM state and calling
hwsync are found in a few places.  This patch simplifies them by
creating a common helper function.

It also fixes a couple of cases where we missed the proper state check
(e.g. PAUSED state wasn't handled in rewind and snd_pcm_hwsync()),
too.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_native.c