Changeset 703 for GPL/trunk/alsa-kernel/pci/sonicvibes.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/sonicvibes.c
r695 r703 853 853 int err; 854 854 855 if ((err = snd_pcm_new(sonic->card, "s3_86c617", device, 1, 1, &pcm)) < 0) 855 err = snd_pcm_new(sonic->card, "s3_86c617", device, 1, 1, &pcm); 856 if (err < 0) 856 857 return err; 857 858 if (snd_BUG_ON(!pcm)) … … 1094 1095 1095 1096 for (idx = 0; idx < ARRAY_SIZE(snd_sonicvibes_controls); idx++) { 1096 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_sonicvibes_controls[idx], sonic))) < 0) 1097 kctl = snd_ctl_new1(&snd_sonicvibes_controls[idx], sonic); 1098 err = snd_ctl_add(card, kctl); 1099 if (err < 0) 1097 1100 return err; 1098 1101 switch (idx) { … … 1227 1230 *rsonic = NULL; 1228 1231 /* enable PCI device */ 1229 if ((err = pci_enable_device(pci)) < 0) 1232 err = pci_enable_device(pci); 1233 if (err < 0) 1230 1234 return err; 1231 1235 /* check, if we can restrict PCI DMA transfers to 24 bits */ … … 1247 1251 sonic->irq = -1; 1248 1252 1249 if ((err = pci_request_regions(pci, "S3 SonicVibes")) < 0) { 1253 err = pci_request_regions(pci, "S3 SonicVibes"); 1254 if (err < 0) { 1250 1255 kfree(sonic); 1251 1256 pci_disable_device(pci); … … 1290 1295 pci_write_config_dword(pci, 0x48, dmac); 1291 1296 1292 if ((sonic->res_dmaa = request_region(dmaa, 0x10, "S3 SonicVibes DDMA-A")) == NULL) { 1297 sonic->res_dmaa = request_region(dmaa, 0x10, "S3 SonicVibes DDMA-A"); 1298 if (!sonic->res_dmaa) { 1293 1299 snd_sonicvibes_free(sonic); 1294 1300 dev_err(card->dev, … … 1297 1303 return -EBUSY; 1298 1304 } 1299 if ((sonic->res_dmac = request_region(dmac, 0x10, "S3 SonicVibes DDMA-C")) == NULL) { 1305 sonic->res_dmac = request_region(dmac, 0x10, "S3 SonicVibes DDMA-C"); 1306 if (!sonic->res_dmac) { 1300 1307 snd_sonicvibes_free(sonic); 1301 1308 dev_err(card->dev, … … 1359 1366 sonic->revision = snd_sonicvibes_in(sonic, SV_IREG_REVISION); 1360 1367 1361 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, sonic, &ops)) < 0) { 1368 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, sonic, &ops); 1369 if (err < 0) { 1362 1370 snd_sonicvibes_free(sonic); 1363 1371 return err; … … 1406 1414 mpu->open_input = snd_sonicvibes_midi_input_open; 1407 1415 mpu->close_input = snd_sonicvibes_midi_input_close; 1408 for (idx = 0; idx < ARRAY_SIZE(snd_sonicvibes_midi_controls); idx++) 1409 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_sonicvibes_midi_controls[idx], sonic))) < 0) 1416 for (idx = 0; idx < ARRAY_SIZE(snd_sonicvibes_midi_controls); idx++) { 1417 err = snd_ctl_add(card, snd_ctl_new1(&snd_sonicvibes_midi_controls[idx], sonic)); 1418 if (err < 0) 1410 1419 return err; 1420 } 1411 1421 return 0; 1412 1422 } … … 1440 1450 } 1441 1451 } 1442 if ((err = snd_sonicvibes_create(card, pci, 1443 reverb[dev] ? 1 : 0, 1444 mge[dev] ? 1 : 0, 1445 &sonic)) < 0) { 1452 err = snd_sonicvibes_create(card, pci, 1453 reverb[dev] ? 1 : 0, 1454 mge[dev] ? 1 : 0, 1455 &sonic); 1456 if (err < 0) { 1446 1457 snd_card_free(card); 1447 1458 return err; … … 1456 1467 sonic->irq); 1457 1468 1458 if ((err = snd_sonicvibes_pcm(sonic, 0)) < 0) { 1469 err = snd_sonicvibes_pcm(sonic, 0); 1470 if (err < 0) { 1459 1471 snd_card_free(card); 1460 1472 return err; 1461 1473 } 1462 if ((err = snd_sonicvibes_mixer(sonic)) < 0) { 1474 err = snd_sonicvibes_mixer(sonic); 1475 if (err < 0) { 1463 1476 snd_card_free(card); 1464 1477 return err; 1465 1478 } 1466 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SONICVIBES, 1467 sonic->midi_port, 1468 MPU401_INFO_INTEGRATED | 1469 MPU401_INFO_IRQ_HOOK, 1470 -1, &midi_uart)) < 0) { 1479 err = snd_mpu401_uart_new(card, 0, MPU401_HW_SONICVIBES, 1480 sonic->midi_port, 1481 MPU401_INFO_INTEGRATED | 1482 MPU401_INFO_IRQ_HOOK, 1483 -1, &midi_uart); 1484 if (err < 0) { 1471 1485 snd_card_free(card); 1472 1486 return err; 1473 1487 } 1474 1488 snd_sonicvibes_midi(sonic, midi_uart); 1475 if ((err = snd_opl3_create(card, sonic->synth_port, 1476 sonic->synth_port + 2, 1477 OPL3_HW_OPL3_SV, 1, &opl3)) < 0) { 1489 err = snd_opl3_create(card, sonic->synth_port, 1490 sonic->synth_port + 2, 1491 OPL3_HW_OPL3_SV, 1, &opl3); 1492 if (err < 0) { 1478 1493 snd_card_free(card); 1479 1494 return err; 1480 1495 } 1481 if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 1496 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 1497 if (err < 0) { 1482 1498 snd_card_free(card); 1483 1499 return err; … … 1490 1506 } 1491 1507 1492 if ((err = snd_card_register(card)) < 0) { 1508 err = snd_card_register(card); 1509 if (err < 0) { 1493 1510 snd_card_free(card); 1494 1511 return err;
Note:
See TracChangeset
for help on using the changeset viewer.