Changeset 703 for GPL/trunk/alsa-kernel/pci/fm801.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/fm801.c
r695 r703 668 668 &hw_constraints_channels); 669 669 } 670 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 670 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 671 if (err < 0) 671 672 return err; 672 673 return 0; … … 683 684 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 684 685 &hw_constraints_rates); 685 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 686 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 687 if (err < 0) 686 688 return err; 687 689 return 0; … … 726 728 int err; 727 729 728 if ((err = snd_pcm_new(chip->card, "FM801", device, 1, 1, &pcm)) < 0) 730 err = snd_pcm_new(chip->card, "FM801", device, 1, 1, &pcm); 731 if (err < 0) 729 732 return err; 730 733 … … 994 997 unsigned short val; 995 998 996 if ((val = ucontrol->value.enumerated.item[0]) > 4) 999 val = ucontrol->value.enumerated.item[0]; 1000 if (val > 4) 997 1001 return -EINVAL; 998 1002 return snd_fm801_update_bits(chip, FM801_REC_SRC, 7, val); … … 1059 1063 }; 1060 1064 1061 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus)) < 0) 1065 err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus); 1066 if (err < 0) 1062 1067 return err; 1063 1068 chip->ac97_bus->private_free = snd_fm801_mixer_free_ac97_bus; … … 1066 1071 ac97.private_data = chip; 1067 1072 ac97.private_free = snd_fm801_mixer_free_ac97; 1068 if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97)) < 0) 1073 err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97); 1074 if (err < 0) 1069 1075 return err; 1070 1076 if (chip->secondary) { 1071 1077 ac97.num = 1; 1072 1078 ac97.addr = chip->secondary_addr; 1073 if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97_sec)) < 0) 1079 err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97_sec); 1080 if (err < 0) 1074 1081 return err; 1075 1082 } … … 1223 1230 *rchip = NULL; 1224 1231 #ifndef TARGET_OS2 1225 if ((err = pcim_enable_device(pci)) < 0) 1232 err = pcim_enable_device(pci); 1233 if (err < 0) 1226 1234 return err; 1227 1235 chip = devm_kzalloc(&pci->dev, sizeof(*chip), GFP_KERNEL); … … 1238 1246 chip->irq = -1; 1239 1247 chip->tea575x_tuner = tea575x_tuner; 1240 if ((err = pci_request_regions(pci, "FM801")) < 0) 1248 err = pci_request_regions(pci, "FM801"); 1249 if (err < 0) 1241 1250 return err; 1242 1251 chip->port = pci_resource_start(pci, 0); … … 1278 1287 snd_fm801_chip_init(chip); 1279 1288 1280 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 1289 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 1290 if (err < 0) { 1281 1291 snd_fm801_free(chip); 1282 1292 return err; … … 1351 1361 if (err < 0) 1352 1362 return err; 1353 if ((err = snd_fm801_create(card, pci, tea575x_tuner[dev], radio_nr[dev], &chip)) < 0) { 1363 err = snd_fm801_create(card, pci, tea575x_tuner[dev], radio_nr[dev], &chip); 1364 if (err < 0) { 1354 1365 snd_card_free(card); 1355 1366 return err; … … 1366 1377 goto __fm801_tuner_only; 1367 1378 1368 if ((err = snd_fm801_pcm(chip, 0)) < 0) { 1379 err = snd_fm801_pcm(chip, 0); 1380 if (err < 0) { 1369 1381 snd_card_free(card); 1370 1382 return err; 1371 1383 } 1372 if ((err = snd_fm801_mixer(chip)) < 0) { 1384 err = snd_fm801_mixer(chip); 1385 if (err < 0) { 1373 1386 snd_card_free(card); 1374 1387 return err; 1375 1388 } 1376 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_FM801, 1377 chip->port + FM801_MPU401_DATA, 1378 MPU401_INFO_INTEGRATED | 1379 MPU401_INFO_IRQ_HOOK, 1380 -1, &chip->rmidi)) < 0) { 1389 err = snd_mpu401_uart_new(card, 0, MPU401_HW_FM801, 1390 chip->port + FM801_MPU401_DATA, 1391 MPU401_INFO_INTEGRATED | 1392 MPU401_INFO_IRQ_HOOK, 1393 -1, &chip->rmidi); 1394 if (err < 0) { 1381 1395 snd_card_free(card); 1382 1396 return err; 1383 1397 } 1384 if ((err = snd_opl3_create(card, chip->port + FM801_OPL3_BANK0, 1385 chip->port + FM801_OPL3_BANK1, 1386 OPL3_HW_OPL3_FM801, 1, &opl3)) < 0) { 1398 err = snd_opl3_create(card, chip->port + FM801_OPL3_BANK0, 1399 chip->port + FM801_OPL3_BANK1, 1400 OPL3_HW_OPL3_FM801, 1, &opl3); 1401 if (err < 0) { 1387 1402 snd_card_free(card); 1388 1403 return err; 1389 1404 } 1390 if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 1405 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 1406 if (err < 0) { 1391 1407 snd_card_free(card); 1392 1408 return err; … … 1394 1410 1395 1411 __fm801_tuner_only: 1396 if ((err = snd_card_register(card)) < 0) { 1412 err = snd_card_register(card); 1413 if (err < 0) { 1397 1414 snd_card_free(card); 1398 1415 return err;
Note:
See TracChangeset
for help on using the changeset viewer.