Commit f804fff1 authored by Markus Elfring's avatar Markus Elfring Committed by Takashi Iwai

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d2d97708
...@@ -143,37 +143,32 @@ static int usb6fire_chip_probe(struct usb_interface *intf, ...@@ -143,37 +143,32 @@ static int usb6fire_chip_probe(struct usb_interface *intf,
chip->card = card; chip->card = card;
ret = usb6fire_comm_init(chip); ret = usb6fire_comm_init(chip);
if (ret < 0) { if (ret < 0)
usb6fire_chip_destroy(chip); goto destroy_chip;
return ret;
}
ret = usb6fire_midi_init(chip); ret = usb6fire_midi_init(chip);
if (ret < 0) { if (ret < 0)
usb6fire_chip_destroy(chip); goto destroy_chip;
return ret;
}
ret = usb6fire_pcm_init(chip); ret = usb6fire_pcm_init(chip);
if (ret < 0) { if (ret < 0)
usb6fire_chip_destroy(chip); goto destroy_chip;
return ret;
}
ret = usb6fire_control_init(chip); ret = usb6fire_control_init(chip);
if (ret < 0) { if (ret < 0)
usb6fire_chip_destroy(chip); goto destroy_chip;
return ret;
}
ret = snd_card_register(card); ret = snd_card_register(card);
if (ret < 0) { if (ret < 0) {
dev_err(&intf->dev, "cannot register card."); dev_err(&intf->dev, "cannot register card.");
usb6fire_chip_destroy(chip); goto destroy_chip;
return ret;
} }
usb_set_intfdata(intf, chip); usb_set_intfdata(intf, chip);
return 0; return 0;
destroy_chip:
usb6fire_chip_destroy(chip);
return ret;
} }
static void usb6fire_chip_disconnect(struct usb_interface *intf) static void usb6fire_chip_disconnect(struct usb_interface *intf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment