mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 01:09:38 -05:00
ALSA: 6fire: Use common error handling code in usb6fire_chip_probe()
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>
This commit is contained in:
parent
d2d9770879
commit
f804fff136
1 changed files with 13 additions and 18 deletions
|
@ -143,37 +143,32 @@ static int usb6fire_chip_probe(struct usb_interface *intf,
|
|||
chip->card = card;
|
||||
|
||||
ret = usb6fire_comm_init(chip);
|
||||
if (ret < 0) {
|
||||
usb6fire_chip_destroy(chip);
|
||||
return ret;
|
||||
}
|
||||
if (ret < 0)
|
||||
goto destroy_chip;
|
||||
|
||||
ret = usb6fire_midi_init(chip);
|
||||
if (ret < 0) {
|
||||
usb6fire_chip_destroy(chip);
|
||||
return ret;
|
||||
}
|
||||
if (ret < 0)
|
||||
goto destroy_chip;
|
||||
|
||||
ret = usb6fire_pcm_init(chip);
|
||||
if (ret < 0) {
|
||||
usb6fire_chip_destroy(chip);
|
||||
return ret;
|
||||
}
|
||||
if (ret < 0)
|
||||
goto destroy_chip;
|
||||
|
||||
ret = usb6fire_control_init(chip);
|
||||
if (ret < 0) {
|
||||
usb6fire_chip_destroy(chip);
|
||||
return ret;
|
||||
}
|
||||
if (ret < 0)
|
||||
goto destroy_chip;
|
||||
|
||||
ret = snd_card_register(card);
|
||||
if (ret < 0) {
|
||||
dev_err(&intf->dev, "cannot register card.");
|
||||
usb6fire_chip_destroy(chip);
|
||||
return ret;
|
||||
goto destroy_chip;
|
||||
}
|
||||
usb_set_intfdata(intf, chip);
|
||||
return 0;
|
||||
|
||||
destroy_chip:
|
||||
usb6fire_chip_destroy(chip);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void usb6fire_chip_disconnect(struct usb_interface *intf)
|
||||
|
|
Loading…
Add table
Reference in a new issue