summaryrefslogtreecommitdiff
path: root/sound/firewire/bebob
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2015-09-19 05:21:49 +0300
committerTakashi Iwai <tiwai@suse.de>2015-09-29 13:35:45 +0300
commit547e631ce3886175a33b5ccf67729bdd18e9b7e0 (patch)
tree8c48fda0c7a8c5442d00a100901bd1747e349155 /sound/firewire/bebob
parent10b2b6dc1a6bb287411045c788f76d53f96c11bc (diff)
downloadlinux-547e631ce3886175a33b5ccf67729bdd18e9b7e0.tar.xz
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>
Diffstat (limited to 'sound/firewire/bebob')
-rw-r--r--sound/firewire/bebob/bebob_stream.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c
index 5be5242e1ed8..c642b79e7ed4 100644
--- a/sound/firewire/bebob/bebob_stream.c
+++ b/sound/firewire/bebob/bebob_stream.c
@@ -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,