Changeset 703 for GPL/trunk/alsa-kernel/pci/cs4281.c
- Timestamp:
- Sep 26, 2021, 6:18:40 PM (4 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-next merged: 696-702
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/pci/cs4281.c
r695 r703 1072 1072 }; 1073 1073 1074 if ((err = snd_ac97_bus(card, 0, &ops, chip, &chip->ac97_bus)) < 0) 1074 err = snd_ac97_bus(card, 0, &ops, chip, &chip->ac97_bus); 1075 if (err < 0) 1075 1076 return err; 1076 1077 chip->ac97_bus->private_free = snd_cs4281_mixer_free_ac97_bus; … … 1079 1080 ac97.private_data = chip; 1080 1081 ac97.private_free = snd_cs4281_mixer_free_ac97; 1081 if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97)) < 0) 1082 err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97); 1083 if (err < 0) 1082 1084 return err; 1083 1085 if (chip->dual_codec) { 1084 1086 ac97.num = 1; 1085 if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97_secondary)) < 0) 1087 err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97_secondary); 1088 if (err < 0) 1086 1089 return err; 1087 1090 } 1088 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_cs4281_fm_vol, chip))) < 0) 1091 err = snd_ctl_add(card, snd_ctl_new1(&snd_cs4281_fm_vol, chip)); 1092 if (err < 0) 1089 1093 return err; 1090 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_cs4281_pcm_vol, chip))) < 0) 1094 err = snd_ctl_add(card, snd_ctl_new1(&snd_cs4281_pcm_vol, chip)); 1095 if (err < 0) 1091 1096 return err; 1092 1097 return 0; … … 1312 1317 1313 1318 *rchip = NULL; 1314 if ((err = pci_enable_device(pci)) < 0) 1319 err = pci_enable_device(pci); 1320 if (err < 0) 1315 1321 return err; 1316 1322 chip = kzalloc(sizeof(*chip), GFP_KERNEL); … … 1330 1336 chip->dual_codec = dual_codec; 1331 1337 1332 if ((err = pci_request_regions(pci, "CS4281")) < 0) { 1338 err = pci_request_regions(pci, "CS4281"); 1339 if (err < 0) { 1333 1340 kfree(chip); 1334 1341 pci_disable_device(pci); … … 1360 1367 } 1361 1368 1362 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 1369 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 1370 if (err < 0) { 1363 1371 snd_cs4281_free(chip); 1364 1372 return err; … … 1399 1407 snd_cs4281_pokeBA0(chip, BA0_CWPR, 0x4281); 1400 1408 1401 if ((tmp = snd_cs4281_peekBA0(chip, BA0_SERC1)) != (BA0_SERC1_SO1EN | BA0_SERC1_AC97)) { 1409 tmp = snd_cs4281_peekBA0(chip, BA0_SERC1); 1410 if (tmp != (BA0_SERC1_SO1EN | BA0_SERC1_AC97)) { 1402 1411 dev_err(chip->card->dev, 1403 1412 "SERC1 AC'97 check failed (0x%x)\n", tmp); 1404 1413 return -EIO; 1405 1414 } 1406 if ((tmp = snd_cs4281_peekBA0(chip, BA0_SERC2)) != (BA0_SERC2_SI1EN | BA0_SERC2_AC97)) { 1415 tmp = snd_cs4281_peekBA0(chip, BA0_SERC2); 1416 if (tmp != (BA0_SERC2_SI1EN | BA0_SERC2_AC97)) { 1407 1417 dev_err(chip->card->dev, 1408 1418 "SERC2 AC'97 check failed (0x%x)\n", tmp); … … 1752 1762 int err; 1753 1763 1754 if ((err = snd_rawmidi_new(chip->card, "CS4281", device, 1, 1, &rmidi)) < 0) 1764 err = snd_rawmidi_new(chip->card, "CS4281", device, 1, 1, &rmidi); 1765 if (err < 0) 1755 1766 return err; 1756 1767 strcpy(rmidi->name, "CS4281"); … … 1885 1896 return err; 1886 1897 1887 if ((err = snd_cs4281_create(card, pci, &chip, dual_codec[dev])) < 0) { 1898 err = snd_cs4281_create(card, pci, &chip, dual_codec[dev]); 1899 if (err < 0) { 1888 1900 snd_card_free(card); 1889 1901 return err; … … 1891 1903 card->private_data = chip; 1892 1904 1893 if ((err = snd_cs4281_mixer(chip)) < 0) { 1905 err = snd_cs4281_mixer(chip); 1906 if (err < 0) { 1894 1907 snd_card_free(card); 1895 1908 return err; 1896 1909 } 1897 if ((err = snd_cs4281_pcm(chip, 0)) < 0) { 1910 err = snd_cs4281_pcm(chip, 0); 1911 if (err < 0) { 1898 1912 snd_card_free(card); 1899 1913 return err; 1900 1914 } 1901 if ((err = snd_cs4281_midi(chip, 0)) < 0) { 1915 err = snd_cs4281_midi(chip, 0); 1916 if (err < 0) { 1902 1917 snd_card_free(card); 1903 1918 return err; 1904 1919 } 1905 if ((err = snd_opl3_new(card, OPL3_HW_OPL3_CS4281, &opl3)) < 0) { 1920 err = snd_opl3_new(card, OPL3_HW_OPL3_CS4281, &opl3); 1921 if (err < 0) { 1906 1922 snd_card_free(card); 1907 1923 return err; … … 1910 1926 opl3->command = snd_cs4281_opl3_command; 1911 1927 snd_opl3_init(opl3); 1912 if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 1928 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 1929 if (err < 0) { 1913 1930 snd_card_free(card); 1914 1931 return err; … … 1922 1939 chip->irq); 1923 1940 1924 if ((err = snd_card_register(card)) < 0) { 1941 err = snd_card_register(card); 1942 if (err < 0) { 1925 1943 snd_card_free(card); 1926 1944 return err;
Note:
See TracChangeset
for help on using the changeset viewer.