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>

authored by

Markus Elfring and committed by
Takashi Iwai
f16e666b 2a0d85d9

+8 -8
+8 -8
sound/firewire/motu/motu-stream.c
··· 253 253 if (err < 0) { 254 254 dev_err(&motu->unit->device, 255 255 "fail to start isochronous comm: %d\n", err); 256 - stop_both_streams(motu); 257 - return err; 256 + goto stop_streams; 258 257 } 259 258 260 259 err = start_isoc_ctx(motu, &motu->rx_stream); 261 260 if (err < 0) { 262 261 dev_err(&motu->unit->device, 263 262 "fail to start IT context: %d\n", err); 264 - stop_both_streams(motu); 265 - return err; 263 + goto stop_streams; 266 264 } 267 265 268 266 err = protocol->switch_fetching_mode(motu, true); 269 267 if (err < 0) { 270 268 dev_err(&motu->unit->device, 271 269 "fail to enable frame fetching: %d\n", err); 272 - stop_both_streams(motu); 273 - return err; 270 + goto stop_streams; 274 271 } 275 272 } 276 273 ··· 278 281 dev_err(&motu->unit->device, 279 282 "fail to start IR context: %d", err); 280 283 amdtp_stream_stop(&motu->rx_stream); 281 - stop_both_streams(motu); 282 - return err; 284 + goto stop_streams; 283 285 } 284 286 } 285 287 286 288 return 0; 289 + 290 + stop_streams: 291 + stop_both_streams(motu); 292 + return err; 287 293 } 288 294 289 295 void snd_motu_stream_stop_duplex(struct snd_motu *motu)