ALSA: firewire-lib: return error code when amdtp_stream_set_parameters() detects error

Currently, amdtp_stream_set_parameters() returns no error even if wrong
arguments are given. This is not good for streaming layer because drivers
can continue processing ignoring capability of streaming layer.

This commit changes this function to return error code.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Sakamoto
2015-09-19 11:21:49 +09:00
committed by Takashi Iwai
parent 10b2b6dc1a
commit 547e631ce3
6 changed files with 37 additions and 22 deletions

View File

@@ -427,12 +427,17 @@ make_both_connections(struct snd_bebob *bebob, unsigned int rate)
index = get_formation_index(rate);
pcm_channels = bebob->tx_stream_formations[index].pcm;
midi_channels = bebob->tx_stream_formations[index].midi;
amdtp_stream_set_parameters(&bebob->tx_stream,
rate, pcm_channels, midi_channels * 8);
err = amdtp_stream_set_parameters(&bebob->tx_stream, rate,
pcm_channels, midi_channels * 8);
if (err < 0)
goto end;
pcm_channels = bebob->rx_stream_formations[index].pcm;
midi_channels = bebob->rx_stream_formations[index].midi;
amdtp_stream_set_parameters(&bebob->rx_stream,
rate, pcm_channels, midi_channels * 8);
err = amdtp_stream_set_parameters(&bebob->rx_stream, rate,
pcm_channels, midi_channels * 8);
if (err < 0)
goto end;
/* establish connections for both streams */
err = cmp_connection_establish(&bebob->out_conn,