ALSA: fireface: fix configuration error for nominal sampling transfer frequency
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 10 May 2020 07:42:56 +0000 (16:42 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jun 2020 14:41:56 +0000 (16:41 +0200)
commitb3c6479600cd5f9f156dc66c79d712cd048343d8
treeb5513c9304cf6b4ff6173cf6a001b2df651a5fb4
parent158b7987b50906f7f108cf958fd3924396158104
ALSA: fireface: fix configuration error for nominal sampling transfer frequency

commit bbd6aac3ae15bef762af03bf62e35ace5c4292bd upstream.

128000 and 192000 are congruence modulo 32000, thus it's wrong to
distinguish them as multiple of 32000 and 48000 by modulo 32000 at
first.

Additionally, used condition statement to detect quadruple speed can
cause missing bit flag.

Furthermore, counter to ensure the configuration is wrong and it
causes false positive.

This commit fixes the above three bugs.

Cc: <stable@vger.kernel.org>
Fixes: 60aec494b389 ("ALSA: fireface: support allocate_resources operation in latter protocol")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20200510074301.116224-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/firewire/fireface/ff-protocol-latter.c