ALSA: rme9652: Use common code in hdsp_get_iobox_version()

Add a jump target so that a bit of common code 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
99dcad32 468778a0

+11 -15
+11 -15
sound/pci/rme9652/hdsp.c
··· 793 793 794 794 hdsp_write(hdsp, HDSP_control2Reg, HDSP_S200 | HDSP_PROGRAM); 795 795 hdsp_write (hdsp, HDSP_fifoData, 0); 796 - if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) < 0) { 797 - hdsp->io_type = Multiface; 798 - dev_info(hdsp->card->dev, "Multiface found\n"); 799 - return 0; 800 - } 796 + if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) < 0) 797 + goto set_multi; 801 798 802 799 hdsp_write(hdsp, HDSP_control2Reg, HDSP_S_LOAD); 803 800 hdsp_write(hdsp, HDSP_fifoData, 0); ··· 807 810 hdsp_write(hdsp, HDSP_control2Reg, HDSP_S300); 808 811 hdsp_write(hdsp, HDSP_control2Reg, HDSP_S_LOAD); 809 812 hdsp_write(hdsp, HDSP_fifoData, 0); 810 - if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) == 0) { 811 - hdsp->io_type = Multiface; 812 - dev_info(hdsp->card->dev, "Multiface found\n"); 813 - return 0; 814 - } 813 + if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) == 0) 814 + goto set_multi; 815 815 816 816 hdsp_write(hdsp, HDSP_control2Reg, HDSP_S300); 817 817 hdsp_write(hdsp, HDSP_control2Reg, HDSP_S_LOAD); 818 818 hdsp_write(hdsp, HDSP_fifoData, 0); 819 - if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) < 0) { 820 - hdsp->io_type = Multiface; 821 - dev_info(hdsp->card->dev, "Multiface found\n"); 822 - return 0; 823 - } 819 + if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) < 0) 820 + goto set_multi; 824 821 825 822 hdsp->io_type = RPM; 826 823 dev_info(hdsp->card->dev, "RPM found\n"); ··· 828 837 else 829 838 hdsp->io_type = Digiface; 830 839 } 840 + return 0; 841 + 842 + set_multi: 843 + hdsp->io_type = Multiface; 844 + dev_info(hdsp->card->dev, "Multiface found\n"); 831 845 return 0; 832 846 } 833 847