aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorEldad Zack <eldad@fogrefinery.com>2013-04-22 19:00:42 -0400
committerTakashi Iwai <tiwai@suse.de>2013-04-29 07:37:33 -0400
commit167d0a11d5feedd1f9cb9ae128ac543e97148eff (patch)
treed0e3ffee2a3094769459863ac84acc3f84bd955e /sound
parent74c34ca1cc12884703c70d34ed333517d978c2e7 (diff)
ALSA: asihpi: add format support check in snd_card_asihpi_capture_formats
Some Asihpi formats are not supported or invalid, and their mapping to ALSA format is set to -1. Before performing the format conversion into ALSA bitwise formats, add a consistency check for the requested format, as done in snd_card_asihpi_playback_formats(). Compile tested only. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/asihpi/asihpi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c
index 160cf830d327..fbc17203613c 100644
--- a/sound/pci/asihpi/asihpi.c
+++ b/sound/pci/asihpi/asihpi.c
@@ -1141,7 +1141,7 @@ static u64 snd_card_asihpi_capture_formats(struct snd_card_asihpi *asihpi,
1141 format, sample_rate, 128000, 0); 1141 format, sample_rate, 128000, 0);
1142 if (!err) 1142 if (!err)
1143 err = hpi_instream_query_format(h_stream, &hpi_format); 1143 err = hpi_instream_query_format(h_stream, &hpi_format);
1144 if (!err) 1144 if (!err && (hpi_to_alsa_formats[format] != -1))
1145 formats |= pcm_format_to_bits(hpi_to_alsa_formats[format]); 1145 formats |= pcm_format_to_bits(hpi_to_alsa_formats[format]);
1146 } 1146 }
1147 return formats; 1147 return formats;