summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-09-06 13:30:14 +0200
committerTakashi Iwai <tiwai@suse.de>2017-09-12 09:23:26 +0200
commitf16e666b9b7e07237ca0669df9b89ccf8dfc102c (patch)
tree786a78f2756fee9b20e5dbf6a9266c13c26676c2 /sound
parent2a0d85d9add77bb7a4ddd61557ffb21ca5370d15 (diff)
downloadlinux-f16e666b9b7e07237ca0669df9b89ccf8dfc102c.tar.bz2
ALSA: firewire: Use common error handling code in snd_motu_stream_start_duplex()
Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/firewire/motu/motu-stream.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sound/firewire/motu/motu-stream.c b/sound/firewire/motu/motu-stream.c
index dc5541c8b359..73e7a5e527fc 100644
--- a/sound/firewire/motu/motu-stream.c
+++ b/sound/firewire/motu/motu-stream.c
@@ -253,24 +253,21 @@ int snd_motu_stream_start_duplex(struct snd_motu *motu, unsigned int rate)
if (err < 0) {
dev_err(&motu->unit->device,
"fail to start isochronous comm: %d\n", err);
- stop_both_streams(motu);
- return err;
+ goto stop_streams;
}
err = start_isoc_ctx(motu, &motu->rx_stream);
if (err < 0) {
dev_err(&motu->unit->device,
"fail to start IT context: %d\n", err);
- stop_both_streams(motu);
- return err;
+ goto stop_streams;
}
err = protocol->switch_fetching_mode(motu, true);
if (err < 0) {
dev_err(&motu->unit->device,
"fail to enable frame fetching: %d\n", err);
- stop_both_streams(motu);
- return err;
+ goto stop_streams;
}
}
@@ -281,12 +278,15 @@ int snd_motu_stream_start_duplex(struct snd_motu *motu, unsigned int rate)
dev_err(&motu->unit->device,
"fail to start IR context: %d", err);
amdtp_stream_stop(&motu->rx_stream);
- stop_both_streams(motu);
- return err;
+ goto stop_streams;
}
}
return 0;
+
+stop_streams:
+ stop_both_streams(motu);
+ return err;
}
void snd_motu_stream_stop_duplex(struct snd_motu *motu)