Changeset 703 for GPL/trunk/alsa-kernel/pci
- Timestamp:
- Sep 26, 2021, 6:18:40 PM (4 years ago)
- Location:
- GPL/trunk
- Files:
-
- 69 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/ac97/ac97_codec.c
r679 r703 1333 1333 if (snd_ac97_try_bit(ac97, reg, 15)) { 1334 1334 sprintf(name, "%s Switch", pfx); 1335 if ((err = snd_ac97_cmute_new_stereo(card, name, reg, 1336 check_stereo, check_amix, 1337 ac97)) < 0) 1335 err = snd_ac97_cmute_new_stereo(card, name, reg, 1336 check_stereo, check_amix, 1337 ac97); 1338 if (err < 0) 1338 1339 return err; 1339 1340 } … … 1341 1342 if (lo_max) { 1342 1343 sprintf(name, "%s Volume", pfx); 1343 if ((err = snd_ac97_cvol_new(card, name, reg, lo_max, hi_max, ac97)) < 0) 1344 err = snd_ac97_cvol_new(card, name, reg, lo_max, hi_max, ac97); 1345 if (err < 0) 1344 1346 return err; 1345 1347 } … … 1380 1382 if ((snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER)) 1381 1383 && !(ac97->flags & AC97_AD_MULTI)) { 1382 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_center[0], ac97))) < 0) 1384 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_center[0], ac97)); 1385 if (err < 0) 1383 1386 return err; 1384 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_center[1], ac97))) < 0) 1387 err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_center[1], ac97)); 1388 if (err < 0) 1385 1389 return err; 1386 1390 snd_ac97_change_volume_params2(ac97, AC97_CENTER_LFE_MASTER, 0, &max); … … 1394 1398 if ((snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER+1)) 1395 1399 && !(ac97->flags & AC97_AD_MULTI)) { 1396 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_lfe[0], ac97))) < 0) 1400 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_lfe[0], ac97)); 1401 if (err < 0) 1397 1402 return err; 1398 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_lfe[1], ac97))) < 0) 1403 err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_lfe[1], ac97)); 1404 if (err < 0) 1399 1405 return err; 1400 1406 snd_ac97_change_volume_params2(ac97, AC97_CENTER_LFE_MASTER, 8, &max); … … 1409 1415 && !(ac97->flags & AC97_AD_MULTI)) { 1410 1416 /* Surround Master (0x38) is with stereo mutes */ 1411 if ((err = snd_ac97_cmix_new_stereo(card, "Surround Playback", 1412 AC97_SURROUND_MASTER, 1, 0, 1413 ac97)) < 0) 1417 err = snd_ac97_cmix_new_stereo(card, "Surround Playback", 1418 AC97_SURROUND_MASTER, 1, 0, 1419 ac97); 1420 if (err < 0) 1414 1421 return err; 1415 1422 } … … 1417 1424 /* build headphone controls */ 1418 1425 if (snd_ac97_try_volume_mix(ac97, AC97_HEADPHONE)) { 1419 if ((err = snd_ac97_cmix_new(card, "Headphone Playback", 1420 AC97_HEADPHONE, 0, ac97)) < 0) 1426 err = snd_ac97_cmix_new(card, "Headphone Playback", 1427 AC97_HEADPHONE, 0, ac97); 1428 if (err < 0) 1421 1429 return err; 1422 1430 } … … 1424 1432 /* build master mono controls */ 1425 1433 if (snd_ac97_try_volume_mix(ac97, AC97_MASTER_MONO)) { 1426 if ((err = snd_ac97_cmix_new(card, "Master Mono Playback", 1427 AC97_MASTER_MONO, 0, ac97)) < 0) 1434 err = snd_ac97_cmix_new(card, "Master Mono Playback", 1435 AC97_MASTER_MONO, 0, ac97); 1436 if (err < 0) 1428 1437 return err; 1429 1438 } … … 1433 1442 if (snd_ac97_try_volume_mix(ac97, AC97_MASTER_TONE)) { 1434 1443 for (idx = 0; idx < 2; idx++) { 1435 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_tone[idx], ac97))) < 0) 1444 kctl = snd_ac97_cnew(&snd_ac97_controls_tone[idx], ac97); 1445 err = snd_ctl_add(card, kctl); 1446 if (err < 0) 1436 1447 return err; 1437 1448 if (ac97->id == AC97_ID_YMF743 || … … 1449 1460 ((ac97->flags & AC97_HAS_PC_BEEP) || 1450 1461 snd_ac97_try_volume_mix(ac97, AC97_PC_BEEP))) { 1451 for (idx = 0; idx < 2; idx++) 1452 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_pc_beep[idx], ac97))) < 0) 1462 for (idx = 0; idx < 2; idx++) { 1463 kctl = snd_ac97_cnew(&snd_ac97_controls_pc_beep[idx], ac97); 1464 err = snd_ctl_add(card, kctl); 1465 if (err < 0) 1453 1466 return err; 1467 } 1454 1468 set_tlv_db_scale(kctl, db_scale_4bit); 1455 1469 snd_ac97_write_cache( … … 1464 1478 if (!(ac97->flags & AC97_HAS_NO_PHONE)) { 1465 1479 if (snd_ac97_try_volume_mix(ac97, AC97_PHONE)) { 1466 if ((err = snd_ac97_cmix_new(card, "Phone Playback", 1467 AC97_PHONE, 1, ac97)) < 0) 1480 err = snd_ac97_cmix_new(card, "Phone Playback", 1481 AC97_PHONE, 1, ac97); 1482 if (err < 0) 1468 1483 return err; 1469 1484 } … … 1473 1488 if (!(ac97->flags & AC97_HAS_NO_MIC)) { 1474 1489 if (snd_ac97_try_volume_mix(ac97, AC97_MIC)) { 1475 if ((err = snd_ac97_cmix_new(card, "Mic Playback", 1476 AC97_MIC, 1, ac97)) < 0) 1490 err = snd_ac97_cmix_new(card, "Mic Playback", 1491 AC97_MIC, 1, ac97); 1492 if (err < 0) 1477 1493 return err; 1478 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_mic_boost, ac97))) < 0) 1494 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_mic_boost, ac97)); 1495 if (err < 0) 1479 1496 return err; 1480 1497 } … … 1483 1500 /* build Line controls */ 1484 1501 if (snd_ac97_try_volume_mix(ac97, AC97_LINE)) { 1485 if ((err = snd_ac97_cmix_new(card, "Line Playback", 1486 AC97_LINE, 1, ac97)) < 0) 1502 err = snd_ac97_cmix_new(card, "Line Playback", 1503 AC97_LINE, 1, ac97); 1504 if (err < 0) 1487 1505 return err; 1488 1506 } … … 1491 1509 if (!(ac97->flags & AC97_HAS_NO_CD)) { 1492 1510 if (snd_ac97_try_volume_mix(ac97, AC97_CD)) { 1493 if ((err = snd_ac97_cmix_new(card, "CD Playback", 1494 AC97_CD, 1, ac97)) < 0) 1511 err = snd_ac97_cmix_new(card, "CD Playback", 1512 AC97_CD, 1, ac97); 1513 if (err < 0) 1495 1514 return err; 1496 1515 } … … 1500 1519 if (!(ac97->flags & AC97_HAS_NO_VIDEO)) { 1501 1520 if (snd_ac97_try_volume_mix(ac97, AC97_VIDEO)) { 1502 if ((err = snd_ac97_cmix_new(card, "Video Playback", 1503 AC97_VIDEO, 1, ac97)) < 0) 1521 err = snd_ac97_cmix_new(card, "Video Playback", 1522 AC97_VIDEO, 1, ac97); 1523 if (err < 0) 1504 1524 return err; 1505 1525 } … … 1509 1529 if (!(ac97->flags & AC97_HAS_NO_AUX)) { 1510 1530 if (snd_ac97_try_volume_mix(ac97, AC97_AUX)) { 1511 if ((err = snd_ac97_cmix_new(card, "Aux Playback", 1512 AC97_AUX, 1, ac97)) < 0) 1531 err = snd_ac97_cmix_new(card, "Aux Playback", 1532 AC97_AUX, 1, ac97); 1533 if (err < 0) 1513 1534 return err; 1514 1535 } … … 1522 1543 else 1523 1544 init_val = 0x9f1f; 1524 for (idx = 0; idx < 2; idx++) 1525 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_ad18xx_pcm[idx], ac97))) < 0) 1545 for (idx = 0; idx < 2; idx++) { 1546 kctl = snd_ac97_cnew(&snd_ac97_controls_ad18xx_pcm[idx], ac97); 1547 err = snd_ctl_add(card, kctl); 1548 if (err < 0) 1526 1549 return err; 1550 } 1527 1551 set_tlv_db_scale(kctl, db_scale_5bit); 1528 1552 ac97->spec.ad18xx.pcmreg[0] = init_val; 1529 1553 if (ac97->scaps & AC97_SCAP_SURROUND_DAC) { 1530 for (idx = 0; idx < 2; idx++) 1531 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_ad18xx_surround[idx], ac97))) < 0) 1554 for (idx = 0; idx < 2; idx++) { 1555 kctl = snd_ac97_cnew(&snd_ac97_controls_ad18xx_surround[idx], ac97); 1556 err = snd_ctl_add(card, kctl); 1557 if (err < 0) 1532 1558 return err; 1559 } 1533 1560 set_tlv_db_scale(kctl, db_scale_5bit); 1534 1561 ac97->spec.ad18xx.pcmreg[1] = init_val; 1535 1562 } 1536 1563 if (ac97->scaps & AC97_SCAP_CENTER_LFE_DAC) { 1537 for (idx = 0; idx < 2; idx++) 1538 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_ad18xx_center[idx], ac97))) < 0) 1564 for (idx = 0; idx < 2; idx++) { 1565 kctl = snd_ac97_cnew(&snd_ac97_controls_ad18xx_center[idx], ac97); 1566 err = snd_ctl_add(card, kctl); 1567 if (err < 0) 1539 1568 return err; 1569 } 1540 1570 set_tlv_db_scale(kctl, db_scale_5bit); 1541 for (idx = 0; idx < 2; idx++) 1542 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_ad18xx_lfe[idx], ac97))) < 0) 1571 for (idx = 0; idx < 2; idx++) { 1572 kctl = snd_ac97_cnew(&snd_ac97_controls_ad18xx_lfe[idx], ac97); 1573 err = snd_ctl_add(card, kctl); 1574 if (err < 0) 1543 1575 return err; 1576 } 1544 1577 set_tlv_db_scale(kctl, db_scale_5bit); 1545 1578 ac97->spec.ad18xx.pcmreg[2] = init_val; … … 1562 1595 /* build Capture controls */ 1563 1596 if (!(ac97->flags & AC97_HAS_NO_REC_GAIN)) { 1564 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_control_capture_src, ac97))) < 0) 1597 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_control_capture_src, ac97)); 1598 if (err < 0) 1565 1599 return err; 1566 1600 if (snd_ac97_try_bit(ac97, AC97_REC_GAIN, 15)) { … … 1570 1604 return err; 1571 1605 } 1572 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_control_capture_vol, ac97))) < 0) 1606 kctl = snd_ac97_cnew(&snd_ac97_control_capture_vol, ac97); 1607 err = snd_ctl_add(card, kctl); 1608 if (err < 0) 1573 1609 return err; 1574 1610 set_tlv_db_scale(kctl, db_scale_rec_gain); … … 1578 1614 /* build MIC Capture controls */ 1579 1615 if (snd_ac97_try_volume_mix(ac97, AC97_REC_GAIN_MIC)) { 1580 for (idx = 0; idx < 2; idx++) 1581 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_mic_capture[idx], ac97))) < 0) 1616 for (idx = 0; idx < 2; idx++) { 1617 kctl = snd_ac97_cnew(&snd_ac97_controls_mic_capture[idx], ac97); 1618 err = snd_ctl_add(card, kctl); 1619 if (err < 0) 1582 1620 return err; 1621 } 1583 1622 set_tlv_db_scale(kctl, db_scale_rec_gain); 1584 1623 snd_ac97_write_cache(ac97, AC97_REC_GAIN_MIC, 0x0000); … … 1587 1626 /* build PCM out path & mute control */ 1588 1627 if (snd_ac97_try_bit(ac97, AC97_GENERAL_PURPOSE, 15)) { 1589 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_PCM_OUT], ac97))) < 0) 1628 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_PCM_OUT], ac97)); 1629 if (err < 0) 1590 1630 return err; 1591 1631 } … … 1593 1633 /* build Simulated Stereo Enhancement control */ 1594 1634 if (ac97->caps & AC97_BC_SIM_STEREO) { 1595 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_STEREO_ENHANCEMENT], ac97))) < 0) 1635 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_STEREO_ENHANCEMENT], ac97)); 1636 if (err < 0) 1596 1637 return err; 1597 1638 } … … 1599 1640 /* build 3D Stereo Enhancement control */ 1600 1641 if (snd_ac97_try_bit(ac97, AC97_GENERAL_PURPOSE, 13)) { 1601 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_3D], ac97))) < 0) 1642 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_3D], ac97)); 1643 if (err < 0) 1602 1644 return err; 1603 1645 } … … 1605 1647 /* build Loudness control */ 1606 1648 if (ac97->caps & AC97_BC_LOUDNESS) { 1607 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_LOUDNESS], ac97))) < 0) 1649 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_LOUDNESS], ac97)); 1650 if (err < 0) 1608 1651 return err; 1609 1652 } … … 1611 1654 /* build Mono output select control */ 1612 1655 if (snd_ac97_try_bit(ac97, AC97_GENERAL_PURPOSE, 9)) { 1613 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_MONO], ac97))) < 0) 1656 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_MONO], ac97)); 1657 if (err < 0) 1614 1658 return err; 1615 1659 } … … 1617 1661 /* build Mic select control */ 1618 1662 if (snd_ac97_try_bit(ac97, AC97_GENERAL_PURPOSE, 8)) { 1619 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_MIC], ac97))) < 0) 1663 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_MIC], ac97)); 1664 if (err < 0) 1620 1665 return err; 1621 1666 } … … 1623 1668 /* build ADC/DAC loopback control */ 1624 1669 if (enable_loopback && snd_ac97_try_bit(ac97, AC97_GENERAL_PURPOSE, 7)) { 1625 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_LOOPBACK], ac97))) < 0) 1670 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_general[AC97_GENERAL_LOOPBACK], ac97)); 1671 if (err < 0) 1626 1672 return err; 1627 1673 } … … 1639 1685 val = snd_ac97_read(ac97, AC97_3D_CONTROL); 1640 1686 val = val == 0x0606; 1641 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) 1687 kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97); 1688 err = snd_ctl_add(card, kctl); 1689 if (err < 0) 1642 1690 return err; 1643 1691 if (val) 1644 1692 kctl->private_value = AC97_3D_CONTROL | (9 << 8) | (7 << 16); 1645 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[1], ac97))) < 0) 1693 kctl = snd_ac97_cnew(&snd_ac97_controls_3d[1], ac97); 1694 err = snd_ctl_add(card, kctl); 1695 if (err < 0) 1646 1696 return err; 1647 1697 if (val) … … 1660 1710 if ((ac97->ext_id & AC97_EI_SPDIF) && !(ac97->scaps & AC97_SCAP_NO_SPDIF)) { 1661 1711 if (ac97->build_ops->build_spdif) { 1662 if ((err = ac97->build_ops->build_spdif(ac97)) < 0) 1712 err = ac97->build_ops->build_spdif(ac97); 1713 if (err < 0) 1663 1714 return err; 1664 1715 } else { 1665 for (idx = 0; idx < 5; idx++) 1666 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_spdif[idx], ac97))) < 0) 1716 for (idx = 0; idx < 5; idx++) { 1717 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_spdif[idx], ac97)); 1718 if (err < 0) 1667 1719 return err; 1720 } 1668 1721 if (ac97->build_ops->build_post_spdif) { 1669 if ((err = ac97->build_ops->build_post_spdif(ac97)) < 0) 1722 err = ac97->build_ops->build_post_spdif(ac97); 1723 if (err < 0) 1670 1724 return err; 1671 1725 } … … 1679 1733 1680 1734 /* build chip specific controls */ 1681 if (ac97->build_ops->build_specific) 1682 if ((err = ac97->build_ops->build_specific(ac97)) < 0) 1735 if (ac97->build_ops->build_specific) { 1736 err = ac97->build_ops->build_specific(ac97); 1737 if (err < 0) 1683 1738 return err; 1739 } 1684 1740 1685 1741 if (snd_ac97_try_bit(ac97, AC97_POWERDOWN, 15)) { … … 1689 1745 if (ac97->scaps & AC97_SCAP_INV_EAPD) 1690 1746 set_inv_eapd(ac97, kctl); 1691 if ((err = snd_ctl_add(card, kctl)) < 0) 1747 err = snd_ctl_add(card, kctl); 1748 if (err < 0) 1692 1749 return err; 1693 1750 } … … 1711 1768 1712 1769 /* build modem switches */ 1713 for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_modem_switches); idx++) 1714 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_ac97_controls_modem_switches[idx], ac97))) < 0) 1770 for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_modem_switches); idx++) { 1771 err = snd_ctl_add(card, snd_ctl_new1(&snd_ac97_controls_modem_switches[idx], ac97)); 1772 if (err < 0) 1715 1773 return err; 1774 } 1716 1775 1717 1776 /* build chip specific controls */ 1718 if (ac97->build_ops->build_specific) 1719 if ((err = ac97->build_ops->build_specific(ac97)) < 0) 1777 if (ac97->build_ops->build_specific) { 1778 err = ac97->build_ops->build_specific(ac97); 1779 if (err < 0) 1720 1780 return err; 1781 } 1721 1782 1722 1783 return 0; … … 1963 2024 spin_lock_init(&bus->bus_lock); 1964 2025 snd_ac97_bus_proc_init(bus); 1965 if ((err = snd_device_new(card, SNDRV_DEV_BUS, bus, &dev_ops)) < 0) { 2026 err = snd_device_new(card, SNDRV_DEV_BUS, bus, &dev_ops); 2027 if (err < 0) { 1966 2028 snd_ac97_bus_free(bus); 1967 2029 return err; … … 1992 2054 ac97->bus->card->number, ac97->num, 1993 2055 snd_ac97_get_short_name(ac97)); 1994 if ((err = device_register(&ac97->dev)) < 0) { 2056 err = device_register(&ac97->dev); 2057 if (err < 0) { 1995 2058 ac97_err(ac97, "Can't register ac97 bus\n"); 1996 2059 ac97->dev.bus = NULL; … … 2147 2210 /* test if we can write to the record gain volume register */ 2148 2211 snd_ac97_write_cache(ac97, AC97_REC_GAIN, 0x8a06); 2149 if (((err = snd_ac97_read(ac97, AC97_REC_GAIN)) & 0x7fff) == 0x0a06) 2212 err = snd_ac97_read(ac97, AC97_REC_GAIN); 2213 if ((err & 0x7fff) == 0x0a06) 2150 2214 ac97->scaps |= AC97_SCAP_AUDIO; 2151 2215 } … … 2300 2364 } 2301 2365 sprintf(comp, "AC97a:%08x", ac97->id); 2302 if ((err = snd_component_add(card, comp)) < 0) { 2366 err = snd_component_add(card, comp); 2367 if (err < 0) { 2303 2368 snd_ac97_free(ac97); 2304 2369 return err; … … 2320 2385 } 2321 2386 sprintf(comp, "AC97m:%08x", ac97->id); 2322 if ((err = snd_component_add(card, comp)) < 0) { 2387 err = snd_component_add(card, comp); 2388 if (err < 0) { 2323 2389 snd_ac97_free(ac97); 2324 2390 return err; … … 2332 2398 update_power_regs(ac97); 2333 2399 snd_ac97_proc_init(ac97); 2334 if ((err = snd_device_new(card, SNDRV_DEV_CODEC, ac97, &ops)) < 0) { 2400 err = snd_device_new(card, SNDRV_DEV_CODEC, ac97, &ops); 2401 if (err < 0) { 2335 2402 snd_ac97_free(ac97); 2336 2403 return err; -
GPL/trunk/alsa-kernel/pci/ac97/ac97_patch.c
r679 r703 30 30 int idx, err; 31 31 32 for (idx = 0; idx < count; idx++) 33 if ((err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&controls[idx], ac97))) < 0) 32 for (idx = 0; idx < count; idx++) { 33 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&controls[idx], ac97)); 34 if (err < 0) 34 35 return err; 36 } 35 37 return 0; 36 38 } … … 417 419 int err; 418 420 419 if ((err = patch_build_controls(ac97, snd_ac97_ymf753_controls_spdif, ARRAY_SIZE(snd_ac97_ymf753_controls_spdif))) < 0) 421 err = patch_build_controls(ac97, snd_ac97_ymf753_controls_spdif, ARRAY_SIZE(snd_ac97_ymf753_controls_spdif)); 422 if (err < 0) 420 423 return err; 421 424 return 0; … … 462 465 463 466 for (i = 0; i < ARRAY_SIZE(wm97xx_snd_ac97_controls); i++) { 464 if ((err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm97xx_snd_ac97_controls[i], ac97))) < 0) 467 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm97xx_snd_ac97_controls[i], ac97)); 468 if (err < 0) 465 469 return err; 466 470 } … … 492 496 int err, i; 493 497 for (i = 0; i < ARRAY_SIZE(wm9704_snd_ac97_controls); i++) { 494 if ((err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm9704_snd_ac97_controls[i], ac97))) < 0) 498 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm9704_snd_ac97_controls[i], ac97)); 499 if (err < 0) 495 500 return err; 496 501 } … … 632 637 633 638 for (i = 0; i < ARRAY_SIZE(wm9711_snd_ac97_controls); i++) { 634 if ((err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm9711_snd_ac97_controls[i], ac97))) < 0) 639 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm9711_snd_ac97_controls[i], ac97)); 640 if (err < 0) 635 641 return err; 636 642 } … … 799 805 800 806 for (i = 0; i < ARRAY_SIZE(wm13_snd_ac97_controls_3d); i++) { 801 if ((err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm13_snd_ac97_controls_3d[i], ac97))) < 0) 807 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm13_snd_ac97_controls_3d[i], ac97)); 808 if (err < 0) 802 809 return err; 803 810 } … … 810 817 811 818 for (i = 0; i < ARRAY_SIZE(wm13_snd_ac97_controls); i++) { 812 if ((err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm13_snd_ac97_controls[i], ac97))) < 0) 819 err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm13_snd_ac97_controls[i], ac97)); 820 if (err < 0) 813 821 return err; 814 822 } … … 884 892 int err; 885 893 886 if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) 894 err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97)); 895 if (err < 0) 887 896 return err; 888 897 strcpy(kctl->id.name, "3D Control Sigmatel - Depth"); … … 897 906 int err; 898 907 899 if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) 908 kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97); 909 err = snd_ctl_add(ac97->bus->card, kctl); 910 if (err < 0) 900 911 return err; 901 912 strcpy(kctl->id.name, "3D Control Sigmatel - Depth"); 902 913 kctl->private_value = AC97_SINGLE_VALUE(AC97_3D_CONTROL, 0, 3, 0); 903 if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) 914 kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97); 915 err = snd_ctl_add(ac97->bus->card, kctl); 916 if (err < 0) 904 917 return err; 905 918 strcpy(kctl->id.name, "3D Control Sigmatel - Rear Depth"); … … 928 941 929 942 snd_ac97_write_cache(ac97, AC97_SIGMATEL_ANALOG, snd_ac97_read(ac97, AC97_SIGMATEL_ANALOG) & ~0x0003); 930 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_ANALOG, 1)) 931 if ((err = patch_build_controls(ac97, &snd_ac97_sigmatel_controls[0], 1)) < 0) 943 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_ANALOG, 1)) { 944 err = patch_build_controls(ac97, &snd_ac97_sigmatel_controls[0], 1); 945 if (err < 0) 932 946 return err; 933 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_ANALOG, 0)) 934 if ((err = patch_build_controls(ac97, &snd_ac97_sigmatel_controls[1], 1)) < 0) 947 } 948 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_ANALOG, 0)) { 949 err = patch_build_controls(ac97, &snd_ac97_sigmatel_controls[1], 1); 950 if (err < 0) 935 951 return err; 936 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_DAC2INVERT, 2)) 937 if ((err = patch_build_controls(ac97, &snd_ac97_sigmatel_4speaker, 1)) < 0) 952 } 953 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_DAC2INVERT, 2)) { 954 err = patch_build_controls(ac97, &snd_ac97_sigmatel_4speaker, 1); 955 if (err < 0) 938 956 return err; 939 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_DAC2INVERT, 3)) 940 if ((err = patch_build_controls(ac97, &snd_ac97_sigmatel_phaseinvert, 1)) < 0) 957 } 958 if (snd_ac97_try_bit(ac97, AC97_SIGMATEL_DAC2INVERT, 3)) { 959 err = patch_build_controls(ac97, &snd_ac97_sigmatel_phaseinvert, 1); 960 if (err < 0) 941 961 return err; 962 } 942 963 return 0; 943 964 } … … 985 1006 986 1007 snd_ac97_rename_vol_ctl(ac97, "Headphone Playback", "Sigmatel Surround Playback"); 987 if ((err = patch_build_controls(ac97, &snd_ac97_stac9708_bias_control, 1)) < 0) 1008 err = patch_build_controls(ac97, &snd_ac97_stac9708_bias_control, 1); 1009 if (err < 0) 988 1010 return err; 989 1011 return patch_sigmatel_stac97xx_specific(ac97); … … 1263 1285 1264 1286 /* con mask, pro mask, default */ 1265 if ((err = patch_build_controls(ac97, &snd_ac97_controls_spdif[0], 3)) < 0) 1287 err = patch_build_controls(ac97, &snd_ac97_controls_spdif[0], 3); 1288 if (err < 0) 1266 1289 return err; 1267 1290 /* switch, spsa */ 1268 if ((err = patch_build_controls(ac97, &snd_ac97_cirrus_controls_spdif[0], 1)) < 0) 1291 err = patch_build_controls(ac97, &snd_ac97_cirrus_controls_spdif[0], 1); 1292 if (err < 0) 1269 1293 return err; 1270 1294 switch (ac97->id & AC97_ID_CS_MASK) { 1271 1295 case AC97_ID_CS4205: 1272 if ((err = patch_build_controls(ac97, &snd_ac97_cirrus_controls_spdif[1], 1)) < 0) 1296 err = patch_build_controls(ac97, &snd_ac97_cirrus_controls_spdif[1], 1); 1297 if (err < 0) 1273 1298 return err; 1274 1299 break; … … 1325 1350 1326 1351 /* con mask, pro mask, default */ 1327 if ((err = patch_build_controls(ac97, &snd_ac97_controls_spdif[0], 3)) < 0) 1352 err = patch_build_controls(ac97, &snd_ac97_controls_spdif[0], 3); 1353 if (err < 0) 1328 1354 return err; 1329 1355 /* switch */ 1330 if ((err = patch_build_controls(ac97, &snd_ac97_conexant_controls_spdif[0], 1)) < 0) 1356 err = patch_build_controls(ac97, &snd_ac97_conexant_controls_spdif[0], 1); 1357 if (err < 0) 1331 1358 return err; 1332 1359 /* set default PCM S/PDIF params */ … … 1593 1620 int err; 1594 1621 1595 if ((err = patch_build_controls(ac97, snd_ac97_controls_ad1885, ARRAY_SIZE(snd_ac97_controls_ad1885))) < 0) 1622 err = patch_build_controls(ac97, snd_ac97_controls_ad1885, ARRAY_SIZE(snd_ac97_controls_ad1885)); 1623 if (err < 0) 1596 1624 return err; 1597 1625 reset_tlv(ac97, "Headphone Playback Volume", … … 1876 1904 int err; 1877 1905 1878 if ((err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1)) < 0) 1906 err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1); 1907 if (err < 0) 1879 1908 return err; 1880 1909 if (check_list(ac97, ad1981_jacks_denylist)) … … 2061 2090 int err; 2062 2091 2063 if ((err = patch_ad1888_specific(ac97)) < 0) 2092 err = patch_ad1888_specific(ac97); 2093 if (err < 0) 2064 2094 return err; 2065 2095 return patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1); … … 2169 2199 snd_ac97_rename_vol_ctl(ac97, "Headphone Playback", "Master Playback"); 2170 2200 2171 if ((err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1)) < 0) 2201 err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1); 2202 if (err < 0) 2172 2203 return err; 2173 2204 … … 2461 2492 int err; 2462 2493 2463 if ((err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1)) < 0) 2494 err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1); 2495 if (err < 0) 2464 2496 return err; 2465 2497 … … 2583 2615 int err; 2584 2616 2585 if ((err = patch_build_controls(ac97, snd_ac97_controls_alc650, ARRAY_SIZE(snd_ac97_controls_alc650))) < 0) 2617 err = patch_build_controls(ac97, snd_ac97_controls_alc650, ARRAY_SIZE(snd_ac97_controls_alc650)); 2618 if (err < 0) 2586 2619 return err; 2587 2620 if (ac97->ext_id & AC97_EI_SPDIF) { 2588 if ((err = patch_build_controls(ac97, snd_ac97_spdif_controls_alc650, ARRAY_SIZE(snd_ac97_spdif_controls_alc650))) < 0) 2621 err = patch_build_controls(ac97, snd_ac97_spdif_controls_alc650, ARRAY_SIZE(snd_ac97_spdif_controls_alc650)); 2622 if (err < 0) 2589 2623 return err; 2590 2624 } … … 2736 2770 int err; 2737 2771 2738 if ((err = patch_build_controls(ac97, snd_ac97_controls_alc655, ARRAY_SIZE(snd_ac97_controls_alc655))) < 0) 2772 err = patch_build_controls(ac97, snd_ac97_controls_alc655, ARRAY_SIZE(snd_ac97_controls_alc655)); 2773 if (err < 0) 2739 2774 return err; 2740 2775 if (ac97->ext_id & AC97_EI_SPDIF) { 2741 if ((err = patch_build_controls(ac97, snd_ac97_spdif_controls_alc655, ARRAY_SIZE(snd_ac97_spdif_controls_alc655))) < 0) 2776 err = patch_build_controls(ac97, snd_ac97_spdif_controls_alc655, ARRAY_SIZE(snd_ac97_spdif_controls_alc655)); 2777 if (err < 0) 2742 2778 return err; 2743 2779 } … … 2848 2884 int err; 2849 2885 2850 if ((err = patch_build_controls(ac97, snd_ac97_controls_alc850, ARRAY_SIZE(snd_ac97_controls_alc850))) < 0) 2886 err = patch_build_controls(ac97, snd_ac97_controls_alc850, ARRAY_SIZE(snd_ac97_controls_alc850)); 2887 if (err < 0) 2851 2888 return err; 2852 2889 if (ac97->ext_id & AC97_EI_SPDIF) { 2853 if ((err = patch_build_controls(ac97, snd_ac97_spdif_controls_alc655, ARRAY_SIZE(snd_ac97_spdif_controls_alc655))) < 0) 2890 err = patch_build_controls(ac97, snd_ac97_spdif_controls_alc655, ARRAY_SIZE(snd_ac97_spdif_controls_alc655)); 2891 if (err < 0) 2854 2892 return err; 2855 2893 } … … 3438 3476 int err; 3439 3477 3440 if (snd_ac97_try_bit(ac97, 0x5a, 9)) 3441 if ((err = patch_build_controls(ac97, &snd_ac97_controls_vt1616[0], 1)) < 0) 3478 if (snd_ac97_try_bit(ac97, 0x5a, 9)) { 3479 err = patch_build_controls(ac97, &snd_ac97_controls_vt1616[0], 1); 3480 if (err < 0) 3442 3481 return err; 3443 if ((err = patch_build_controls(ac97, &snd_ac97_controls_vt1616[1], ARRAY_SIZE(snd_ac97_controls_vt1616) - 1)) < 0) 3482 } 3483 err = patch_build_controls(ac97, &snd_ac97_controls_vt1616[1], ARRAY_SIZE(snd_ac97_controls_vt1616) - 1); 3484 if (err < 0) 3444 3485 return err; 3445 3486 … … 3811 3852 { 3812 3853 int err; 3813 if ((err = patch_build_controls(ac97, snd_ac97_controls_it2646, ARRAY_SIZE(snd_ac97_controls_it2646))) < 0) 3854 err = patch_build_controls(ac97, snd_ac97_controls_it2646, ARRAY_SIZE(snd_ac97_controls_it2646)); 3855 if (err < 0) 3814 3856 return err; 3815 if ((err = patch_build_controls(ac97, snd_ac97_spdif_controls_it2646, ARRAY_SIZE(snd_ac97_spdif_controls_it2646))) < 0) 3857 err = patch_build_controls(ac97, snd_ac97_spdif_controls_it2646, ARRAY_SIZE(snd_ac97_spdif_controls_it2646)); 3858 if (err < 0) 3816 3859 return err; 3817 3860 return 0; … … 3846 3889 { 3847 3890 int idx, err; 3848 for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_si3036); idx++) 3849 if ((err = snd_ctl_add(ac97->bus->card, snd_ctl_new1(&snd_ac97_controls_si3036[idx], ac97))) < 0) 3891 for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_si3036); idx++) { 3892 err = snd_ctl_add(ac97->bus->card, snd_ctl_new1(&snd_ac97_controls_si3036[idx], ac97)); 3893 if (err < 0) 3850 3894 return err; 3895 } 3851 3896 return 0; 3852 3897 } … … 3913 3958 { 3914 3959 int idx, err; 3915 for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_ucb1400); idx++) 3916 if ((err = snd_ctl_add(ac97->bus->card, snd_ctl_new1(&snd_ac97_controls_ucb1400[idx], ac97))) < 0) 3960 for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_ucb1400); idx++) { 3961 err = snd_ctl_add(ac97->bus->card, snd_ctl_new1(&snd_ac97_controls_ucb1400[idx], ac97)); 3962 if (err < 0) 3917 3963 return err; 3964 } 3918 3965 return 0; 3919 3966 } -
GPL/trunk/alsa-kernel/pci/ad1889.c
r695 r703 853 853 *rchip = NULL; 854 854 855 if ((err = pci_enable_device(pci)) < 0) 855 err = pci_enable_device(pci); 856 if (err < 0) 856 857 return err; 857 858 … … 864 865 865 866 /* allocate chip specific data with zero-filled memory */ 866 if ((chip = kzalloc(sizeof(*chip), GFP_KERNEL)) == NULL) { 867 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 868 if (!chip) { 867 869 pci_disable_device(pci); 868 870 return -ENOMEM; … … 875 877 876 878 /* (1) PCI resource allocation */ 877 if ((err = pci_request_regions(pci, card->driver)) < 0) 879 err = pci_request_regions(pci, card->driver); 880 if (err < 0) 878 881 goto free_and_ret; 879 882 … … 901 904 902 905 /* (2) initialization of the chip hardware */ 903 if ((err = snd_ad1889_init(chip)) < 0) { 906 err = snd_ad1889_init(chip); 907 if (err < 0) { 904 908 snd_ad1889_free(chip); 905 909 return err; 906 910 } 907 911 908 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 912 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 913 if (err < 0) { 909 914 snd_ad1889_free(chip); 910 915 return err; -
GPL/trunk/alsa-kernel/pci/ak4531_codec.c
r679 r703 385 385 *ak4531 = *_ak4531; 386 386 mutex_init(&ak4531->reg_mutex); 387 if ((err = snd_component_add(card, "AK4531")) < 0) { 387 err = snd_component_add(card, "AK4531"); 388 if (err < 0) { 388 389 snd_ak4531_free(ak4531); 389 390 return err; … … 399 400 } 400 401 for (idx = 0; idx < ARRAY_SIZE(snd_ak4531_controls); idx++) { 401 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_ak4531_controls[idx], ak4531))) < 0) { 402 err = snd_ctl_add(card, snd_ctl_new1(&snd_ak4531_controls[idx], ak4531)); 403 if (err < 0) { 402 404 snd_ak4531_free(ak4531); 403 405 return err; … … 405 407 } 406 408 snd_ak4531_proc_init(card, ak4531); 407 if ((err = snd_device_new(card, SNDRV_DEV_CODEC, ak4531, &ops)) < 0) { 409 err = snd_device_new(card, SNDRV_DEV_CODEC, ak4531, &ops); 410 if (err < 0) { 408 411 snd_ak4531_free(ak4531); 409 412 return err; -
GPL/trunk/alsa-kernel/pci/als300.c
r695 r703 299 299 }; 300 300 301 if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &bus)) < 0) 301 err = snd_ac97_bus(chip->card, 0, &ops, NULL, &bus); 302 if (err < 0) 302 303 return err; 303 304 … … 622 623 *rchip = NULL; 623 624 624 if ((err = pci_enable_device(pci)) < 0) 625 err = pci_enable_device(pci); 626 if (err < 0) 625 627 return err; 626 628 … … 644 646 spin_lock_init(&chip->reg_lock); 645 647 646 if ((err = pci_request_regions(pci, "ALS300")) < 0) { 648 err = pci_request_regions(pci, "ALS300"); 649 if (err < 0) { 647 650 kfree(chip); 648 651 pci_disable_device(pci); … … 674 677 } 675 678 676 if ((err = snd_als300_new_pcm(chip)) < 0) { 679 err = snd_als300_new_pcm(chip); 680 if (err < 0) { 677 681 dev_err(card->dev, "Could not create PCM\n"); 678 682 snd_als300_free(chip); … … 680 684 } 681 685 682 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,683 chip, &ops))< 0) {686 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 687 if (err < 0) { 684 688 snd_als300_free(chip); 685 689 return err; … … 742 746 chip_type = pci_id->driver_data; 743 747 744 if ((err = snd_als300_create(card, pci, chip_type, &chip)) < 0) { 748 err = snd_als300_create(card, pci, chip_type, &chip); 749 if (err < 0) { 745 750 snd_card_free(card); 746 751 return err; … … 759 764 card->shortname, chip->port, chip->irq); 760 765 761 if ((err = snd_card_register(card)) < 0) { 766 err = snd_card_register(card); 767 if (err < 0) { 762 768 snd_card_free(card); 763 769 return err; -
GPL/trunk/alsa-kernel/pci/als4000.c
r695 r703 836 836 837 837 /* enable PCI device */ 838 if ((err = pci_enable_device(pci)) < 0) { 838 err = pci_enable_device(pci); 839 if (err < 0) 839 840 return err; 840 } 841 841 842 /* check, if we can restrict PCI DMA transfers to 24 bits */ 842 843 if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(24))) { … … 846 847 } 847 848 848 if ((err = pci_request_regions(pci, "ALS4000")) < 0) { 849 err = pci_request_regions(pci, "ALS4000"); 850 if (err < 0) { 849 851 pci_disable_device(pci); 850 852 return err; … … 873 875 snd_als4000_set_addr(acard->iobase, 0, 0, 0, 0); 874 876 875 if ((err = snd_sbdsp_create(card,876 877 877 err = snd_sbdsp_create(card, 878 iobase + ALS4K_IOB_10_ADLIB_ADDR0, 879 pci->irq, 878 880 /* internally registered as IRQF_SHARED in case of ALS4000 SB */ 879 snd_als4000_interrupt, 880 -1, 881 -1, 882 SB_HW_ALS4000, 883 &chip)) < 0) { 881 snd_als4000_interrupt, 882 -1, 883 -1, 884 SB_HW_ALS4000, 885 &chip); 886 if (err < 0) 884 887 goto out_err; 885 }886 888 acard->chip = chip; 887 889 … … 896 898 card->shortname, chip->alt_port, chip->irq); 897 899 898 if ((err = snd_mpu401_uart_new( card, 0, MPU401_HW_ALS4000, 899 iobase + ALS4K_IOB_30_MIDI_DATA, 900 MPU401_INFO_INTEGRATED | 901 MPU401_INFO_IRQ_HOOK, 902 -1, &chip->rmidi)) < 0) { 900 err = snd_mpu401_uart_new(card, 0, MPU401_HW_ALS4000, 901 iobase + ALS4K_IOB_30_MIDI_DATA, 902 MPU401_INFO_INTEGRATED | 903 MPU401_INFO_IRQ_HOOK, 904 -1, &chip->rmidi); 905 if (err < 0) { 903 906 dev_err(&pci->dev, "no MPU-401 device at 0x%lx?\n", 904 907 iobase + ALS4K_IOB_30_MIDI_DATA); … … 911 914 * SPECS_PAGE: 21 */ 912 915 913 if ((err = snd_als4000_pcm(chip, 0)) < 0) { 916 err = snd_als4000_pcm(chip, 0); 917 if (err < 0) 914 918 goto out_err; 915 } 916 if ((err = snd_sbmixer_new(chip)) < 0) { 919 920 err = snd_sbmixer_new(chip); 921 if (err < 0) 917 922 goto out_err; 918 }919 923 920 924 if (snd_opl3_create(card, … … 926 930 iobase + ALS4K_IOB_12_ADLIB_ADDR2); 927 931 } else { 928 if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 932 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 933 if (err < 0) 929 934 goto out_err; 930 }931 935 } 932 936 933 937 snd_als4000_create_gameport(acard, dev); 934 938 935 if ((err = snd_card_register(card)) < 0) { 939 err = snd_card_register(card); 940 if (err < 0) 936 941 goto out_err; 937 } 942 938 943 pci_set_drvdata(pci, card); 939 944 dev++; -
GPL/trunk/alsa-kernel/pci/atiixp.c
r695 r703 1050 1050 runtime->hw.formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE; 1051 1051 } 1052 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 1052 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 1053 if (err < 0) 1053 1054 return err; 1054 1055 runtime->private_data = dma; … … 1426 1427 return -ENXIO; 1427 1428 1428 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus)) < 0) 1429 err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus); 1430 if (err < 0) 1429 1431 return err; 1430 1432 pbus->clock = clock; … … 1442 1444 if (! chip->spdif_over_aclink) 1443 1445 ac97.scaps |= AC97_SCAP_NO_SPDIF; 1444 if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) { 1446 err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i]); 1447 if (err < 0) { 1445 1448 chip->ac97[i] = NULL; /* to be sure */ 1446 1449 dev_dbg(chip->card->dev, … … 1573 1576 int err; 1574 1577 1575 if ((err = pci_enable_device(pci)) < 0) 1578 err = pci_enable_device(pci); 1579 if (err < 0) 1576 1580 return err; 1577 1581 … … 1587 1591 chip->pci = pci; 1588 1592 chip->irq = -1; 1589 if ((err = pci_request_regions(pci, "ATI IXP AC97")) < 0) { 1593 err = pci_request_regions(pci, "ATI IXP AC97"); 1594 if (err < 0) { 1590 1595 pci_disable_device(pci); 1591 1596 kfree(chip); … … 1610 1615 pci_set_master(pci); 1611 1616 1612 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 1617 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 1618 if (err < 0) { 1613 1619 snd_atiixp_free(chip); 1614 1620 return err; … … 1633 1639 strcpy(card->driver, spdif_aclink ? "ATIIXP" : "ATIIXP-SPDMA"); 1634 1640 strcpy(card->shortname, "ATI IXP"); 1635 if ((err = snd_atiixp_create(card, pci, &chip)) < 0) 1641 err = snd_atiixp_create(card, pci, &chip); 1642 if (err < 0) 1636 1643 goto __error; 1637 1644 card->private_data = chip; 1638 1645 1639 if ((err = snd_atiixp_aclink_reset(chip)) < 0) 1646 err = snd_atiixp_aclink_reset(chip); 1647 if (err < 0) 1640 1648 goto __error; 1641 1649 1642 1650 chip->spdif_over_aclink = spdif_aclink; 1643 1651 1644 if ((err = snd_atiixp_mixer_new(chip, ac97_clock, ac97_quirk)) < 0) 1652 err = snd_atiixp_mixer_new(chip, ac97_clock, ac97_quirk); 1653 if (err < 0) 1645 1654 goto __error; 1646 1655 1647 if ((err = snd_atiixp_pcm_new(chip)) < 0) 1656 err = snd_atiixp_pcm_new(chip); 1657 if (err < 0) 1648 1658 goto __error; 1649 1659 … … 1662 1672 chip->addr, chip->irq); 1663 1673 1664 if ((err = snd_card_register(card)) < 0) 1674 err = snd_card_register(card); 1675 if (err < 0) 1665 1676 goto __error; 1666 1677 -
GPL/trunk/alsa-kernel/pci/atiixp_modem.c
r695 r703 857 857 runtime->hw = snd_atiixp_pcm_hw; 858 858 dma->ac97_pcm_type = pcm_type; 859 if ((err = snd_pcm_hw_constraint_list(runtime, 0,860 SNDRV_PCM_HW_PARAM_RATE,861 &hw_constraints_rates))< 0)859 err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 860 &hw_constraints_rates); 861 if (err < 0) 862 862 return err; 863 if ((err = snd_pcm_hw_constraint_integer(runtime,864 SNDRV_PCM_HW_PARAM_PERIODS))< 0)863 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 864 if (err < 0) 865 865 return err; 866 866 runtime->private_data = dma; … … 1059 1059 return -ENXIO; 1060 1060 1061 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus)) < 0) 1061 err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus); 1062 if (err < 0) 1062 1063 return err; 1063 1064 pbus->clock = clock; … … 1073 1074 ac97.num = i; 1074 1075 ac97.scaps = AC97_SCAP_SKIP_AUDIO | AC97_SCAP_POWER_SAVE; 1075 if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) { 1076 err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i]); 1077 if (err < 0) { 1076 1078 chip->ac97[i] = NULL; /* to be sure */ 1077 1079 dev_dbg(chip->card->dev, … … 1193 1195 int err; 1194 1196 1195 if ((err = pci_enable_device(pci)) < 0) 1197 err = pci_enable_device(pci); 1198 if (err < 0) 1196 1199 return err; 1197 1200 … … 1207 1210 chip->pci = pci; 1208 1211 chip->irq = -1; 1209 if ((err = pci_request_regions(pci, "ATI IXP MC97")) < 0) { 1212 err = pci_request_regions(pci, "ATI IXP MC97"); 1213 if (err < 0) { 1210 1214 kfree(chip); 1211 1215 pci_disable_device(pci); … … 1230 1234 pci_set_master(pci); 1231 1235 1232 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 1236 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 1237 if (err < 0) { 1233 1238 snd_atiixp_free(chip); 1234 1239 return err; … … 1253 1258 strcpy(card->driver, "ATIIXP-MODEM"); 1254 1259 strcpy(card->shortname, "ATI IXP Modem"); 1255 if ((err = snd_atiixp_create(card, pci, &chip)) < 0) 1260 err = snd_atiixp_create(card, pci, &chip); 1261 if (err < 0) 1256 1262 goto __error; 1257 1263 card->private_data = chip; 1258 1264 1259 if ((err = snd_atiixp_aclink_reset(chip)) < 0) 1265 err = snd_atiixp_aclink_reset(chip); 1266 if (err < 0) 1260 1267 goto __error; 1261 1268 1262 if ((err = snd_atiixp_mixer_new(chip, ac97_clock)) < 0) 1269 err = snd_atiixp_mixer_new(chip, ac97_clock); 1270 if (err < 0) 1263 1271 goto __error; 1264 1272 1265 if ((err = snd_atiixp_pcm_new(chip)) < 0) 1273 err = snd_atiixp_pcm_new(chip); 1274 if (err < 0) 1266 1275 goto __error; 1267 1276 … … 1273 1282 card->shortname, pci->revision, chip->addr, chip->irq); 1274 1283 1275 if ((err = snd_card_register(card)) < 0) 1284 err = snd_card_register(card); 1285 if (err < 0) 1276 1286 goto __error; 1277 1287 -
GPL/trunk/alsa-kernel/pci/au88x0/au88x0.c
r695 r703 47 47 { 48 48 int rc; 49 if (!(rc = pci_write_config_byte(vortex, 0x40, 0xff))) { 50 dev_info(&vortex->dev, "vortex latency is 0xff\n"); 49 rc = pci_write_config_byte(vortex, 0x40, 0xff); 50 if (!rc) { 51 dev_info(&vortex->dev, "vortex latency is 0xff\n"); 51 52 } else { 52 53 dev_warn(&vortex->dev, … … 66 67 */ 67 68 68 if (!(rc = pci_read_config_byte(via, 0x42, &value)) 69 && ((value & 0x10) 70 || !(rc = pci_write_config_byte(via, 0x42, value | 0x10)))) { 69 rc = pci_read_config_byte(via, 0x42, &value); 70 if (!rc) { 71 if (!(value & 0x10)) 72 rc = pci_write_config_byte(via, 0x42, value | 0x10); 73 } 74 if (!rc) { 71 75 dev_info(&via->dev, "bridge config is 0x%x\n", value | 0x10); 72 76 } else { … … 103 107 if (fix & 0x1) 104 108 vortex_fix_latency(vortex); 105 if ((fix & 0x2) && (via = pci_get_device(PCI_VENDOR_ID_VIA, 106 PCI_DEVICE_ID_VIA_8365_1, NULL))) 107 vortex_fix_agp_bridge(via); 108 if ((fix & 0x4) && (via = pci_get_device(PCI_VENDOR_ID_VIA, 109 PCI_DEVICE_ID_VIA_82C598_1, NULL))) 110 vortex_fix_agp_bridge(via); 111 if ((fix & 0x8) && (via = pci_get_device(PCI_VENDOR_ID_AMD, 112 PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL))) 109 if (fix & 0x2) 110 via = pci_get_device(PCI_VENDOR_ID_VIA, 111 PCI_DEVICE_ID_VIA_8365_1, NULL); 112 else if (fix & 0x4) 113 via = pci_get_device(PCI_VENDOR_ID_VIA, 114 PCI_DEVICE_ID_VIA_82C598_1, NULL); 115 else if (fix & 0x8) 116 via = pci_get_device(PCI_VENDOR_ID_AMD, 117 PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL); 118 if (via) 113 119 vortex_fix_agp_bridge(via); 114 120 } … … 148 154 149 155 // check PCI availability (DMA). 150 if ((err = pci_enable_device(pci)) < 0) 156 err = pci_enable_device(pci); 157 if (err < 0) 151 158 return err; 152 159 if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32))) { … … 175 182 // Get MMIO area 176 183 // 177 if ((err = pci_request_regions(pci, CARD_NAME_SHORT)) != 0) 184 err = pci_request_regions(pci, CARD_NAME_SHORT); 185 if (err) 178 186 goto regions_out; 179 187 … … 188 196 * This must be done before we do request_irq otherwise we can get spurious 189 197 * interrupts that we do not handle properly and make a mess of things */ 190 if ((err = vortex_core_init(chip)) != 0) { 198 err = vortex_core_init(chip); 199 if (err) { 191 200 dev_err(card->dev, "hw core init failed\n"); 192 201 goto core_out; 193 202 } 194 203 195 if ((err = request_irq(pci->irq, vortex_interrupt,196 IRQF_SHARED, KBUILD_MODNAME,197 chip)) != 0) {204 err = request_irq(pci->irq, vortex_interrupt, 205 IRQF_SHARED, KBUILD_MODNAME, chip); 206 if (err) { 198 207 dev_err(card->dev, "cannot grab irq\n"); 199 208 goto irq_out; … … 206 215 207 216 // Register alsa root device. 208 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 217 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 218 if (err < 0) 209 219 goto alloc_out; 210 }211 220 212 221 *rchip = chip; … … 253 262 254 263 // (3) 255 if ((err = snd_vortex_create(card, pci, &chip)) < 0) { 264 err = snd_vortex_create(card, pci, &chip); 265 if (err < 0) { 256 266 snd_card_free(card); 257 267 return err; … … 279 289 #ifndef CHIP_AU8820 280 290 // ADB SPDIF 281 if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_SPDIF, 1)) < 0) { 291 err = snd_vortex_new_pcm(chip, VORTEX_PCM_SPDIF, 1); 292 if (err < 0) { 282 293 snd_card_free(card); 283 294 return err; 284 295 } 285 296 // A3D 286 if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_A3D, NR_A3D)) < 0) { 297 err = snd_vortex_new_pcm(chip, VORTEX_PCM_A3D, NR_A3D); 298 if (err < 0) { 287 299 snd_card_free(card); 288 300 return err; … … 298 310 #ifndef CHIP_AU8810 299 311 // WT pcm. 300 if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_WT, NR_WT)) < 0) { 312 err = snd_vortex_new_pcm(chip, VORTEX_PCM_WT, NR_WT); 313 if (err < 0) { 301 314 snd_card_free(card); 302 315 return err; 303 316 } 304 317 #endif 305 if ((err = snd_vortex_midi(chip)) < 0) { 318 err = snd_vortex_midi(chip); 319 if (err < 0) { 306 320 snd_card_free(card); 307 321 return err; … … 328 342 329 343 // (5) 330 if ((err = pci_read_config_word(pci, PCI_DEVICE_ID,331 &(chip->device)))< 0) {344 err = pci_read_config_word(pci, PCI_DEVICE_ID, &chip->device); 345 if (err < 0) { 332 346 snd_card_free(card); 333 347 return err; 334 348 } 335 if ((err = pci_read_config_word(pci, PCI_VENDOR_ID,336 &(chip->vendor)))< 0) {349 err = pci_read_config_word(pci, PCI_VENDOR_ID, &chip->vendor); 350 if (err < 0) { 337 351 snd_card_free(card); 338 352 return err; … … 353 367 354 368 // (6) 355 if ((err = snd_card_register(card)) < 0) { 369 err = snd_card_register(card); 370 if (err < 0) { 356 371 snd_card_free(card); 357 372 return err; -
GPL/trunk/alsa-kernel/pci/au88x0/au88x0_a3d.c
r679 r703 850 850 /* HRTF controls. */ 851 851 for (i = 0; i < NR_A3D; i++) { 852 if ((kcontrol =853 snd_ctl_new1(&vortex_a3d_kcontrol, &vortex->a3d[i])) == NULL)852 kcontrol = snd_ctl_new1(&vortex_a3d_kcontrol, &vortex->a3d[i]); 853 if (!kcontrol) 854 854 return -ENOMEM; 855 855 kcontrol->id.numid = CTRLID_HRTF; 856 856 kcontrol->info = snd_vortex_a3d_hrtf_info; 857 857 kcontrol->put = snd_vortex_a3d_hrtf_put; 858 if ((err = snd_ctl_add(vortex->card, kcontrol)) < 0) 858 err = snd_ctl_add(vortex->card, kcontrol); 859 if (err < 0) 859 860 return err; 860 861 } 861 862 /* ITD controls. */ 862 863 for (i = 0; i < NR_A3D; i++) { 863 if ((kcontrol =864 snd_ctl_new1(&vortex_a3d_kcontrol, &vortex->a3d[i])) == NULL)864 kcontrol = snd_ctl_new1(&vortex_a3d_kcontrol, &vortex->a3d[i]); 865 if (!kcontrol) 865 866 return -ENOMEM; 866 867 kcontrol->id.numid = CTRLID_ITD; 867 868 kcontrol->info = snd_vortex_a3d_itd_info; 868 869 kcontrol->put = snd_vortex_a3d_itd_put; 869 if ((err = snd_ctl_add(vortex->card, kcontrol)) < 0) 870 err = snd_ctl_add(vortex->card, kcontrol); 871 if (err < 0) 870 872 return err; 871 873 } 872 874 /* ILD (gains) controls. */ 873 875 for (i = 0; i < NR_A3D; i++) { 874 if ((kcontrol =875 snd_ctl_new1(&vortex_a3d_kcontrol, &vortex->a3d[i])) == NULL)876 kcontrol = snd_ctl_new1(&vortex_a3d_kcontrol, &vortex->a3d[i]); 877 if (!kcontrol) 876 878 return -ENOMEM; 877 879 kcontrol->id.numid = CTRLID_GAINS; 878 880 kcontrol->info = snd_vortex_a3d_ild_info; 879 881 kcontrol->put = snd_vortex_a3d_ild_put; 880 if ((err = snd_ctl_add(vortex->card, kcontrol)) < 0) 882 err = snd_ctl_add(vortex->card, kcontrol); 883 if (err < 0) 881 884 return err; 882 885 } 883 886 /* Filter controls. */ 884 887 for (i = 0; i < NR_A3D; i++) { 885 if ((kcontrol =886 snd_ctl_new1(&vortex_a3d_kcontrol, &vortex->a3d[i])) == NULL)888 kcontrol = snd_ctl_new1(&vortex_a3d_kcontrol, &vortex->a3d[i]); 889 if (!kcontrol) 887 890 return -ENOMEM; 888 891 kcontrol->id.numid = CTRLID_FILTER; 889 892 kcontrol->info = snd_vortex_a3d_filter_info; 890 893 kcontrol->put = snd_vortex_a3d_filter_put; 891 if ((err = snd_ctl_add(vortex->card, kcontrol)) < 0) 894 err = snd_ctl_add(vortex->card, kcontrol); 895 if (err < 0) 892 896 return err; 893 897 } -
GPL/trunk/alsa-kernel/pci/au88x0/au88x0_core.c
r679 r703 2121 2121 } else { 2122 2122 en = 1; 2123 if ((dma =2124 vortex_adb_checkinout(vortex, NULL, en,2125 VORTEX_RESOURCE_DMA))< 0)2123 dma = vortex_adb_checkinout(vortex, NULL, en, 2124 VORTEX_RESOURCE_DMA); 2125 if (dma < 0) 2126 2126 return -EBUSY; 2127 2127 } … … 2141 2141 if (stream->type != VORTEX_PCM_SPDIF) { 2142 2142 for (i = 0; i < nr_ch; i++) { 2143 if ((src[i] = vortex_adb_checkinout(vortex, 2144 stream->resources, en, 2145 VORTEX_RESOURCE_SRC)) < 0) { 2143 src[i] = vortex_adb_checkinout(vortex, 2144 stream->resources, en, 2145 VORTEX_RESOURCE_SRC); 2146 if (src[i] < 0) { 2146 2147 memset(stream->resources, 0, 2147 2148 sizeof(stream->resources)); … … 2149 2150 } 2150 2151 if (stream->type != VORTEX_PCM_A3D) { 2151 if ((mix[i] = vortex_adb_checkinout(vortex, 2152 stream->resources, 2153 en, 2154 VORTEX_RESOURCE_MIXIN)) < 0) { 2152 mix[i] = vortex_adb_checkinout(vortex, 2153 stream->resources, 2154 en, 2155 VORTEX_RESOURCE_MIXIN); 2156 if (mix[i] < 0) { 2155 2157 memset(stream->resources, 2156 2158 0, … … 2163 2165 #ifndef CHIP_AU8820 2164 2166 if (stream->type == VORTEX_PCM_A3D) { 2165 if ((a3d =2166 vortex_adb_checkinout(vortex,2167 stream->resources, en,2168 VORTEX_RESOURCE_A3D))< 0) {2167 a3d = vortex_adb_checkinout(vortex, 2168 stream->resources, en, 2169 VORTEX_RESOURCE_A3D); 2170 if (a3d < 0) { 2169 2171 memset(stream->resources, 0, 2170 2172 sizeof(stream->resources)); … … 2279 2281 /* Get SRC and MIXER hardware resources. */ 2280 2282 for (i = 0; i < nr_ch; i++) { 2281 if ((mix[i] = 2282 vortex_adb_checkinout(vortex, 2283 stream->resources, en, 2284 VORTEX_RESOURCE_MIXOUT)) 2285 < 0) { 2283 mix[i] = vortex_adb_checkinout(vortex, 2284 stream->resources, en, 2285 VORTEX_RESOURCE_MIXOUT); 2286 if (mix[i] < 0) { 2286 2287 memset(stream->resources, 0, 2287 2288 sizeof(stream->resources)); 2288 2289 return -EBUSY; 2289 2290 } 2290 if ((src[i] =2291 vortex_adb_checkinout(vortex,2292 stream->resources, en,2293 VORTEX_RESOURCE_SRC))< 0) {2291 src[i] = vortex_adb_checkinout(vortex, 2292 stream->resources, en, 2293 VORTEX_RESOURCE_SRC); 2294 if (src[i] < 0) { 2294 2295 memset(stream->resources, 0, 2295 2296 sizeof(stream->resources)); -
GPL/trunk/alsa-kernel/pci/au88x0/au88x0_eq.c
r679 r703 874 874 vortex_Eqlzr_init(vortex); 875 875 876 if ((kcontrol =877 snd_ctl_new1(&vortex_eqtoggle_kcontrol, vortex)) == NULL)876 kcontrol = snd_ctl_new1(&vortex_eqtoggle_kcontrol, vortex); 877 if (!kcontrol) 878 878 return -ENOMEM; 879 879 kcontrol->private_value = 0; 880 if ((err = snd_ctl_add(vortex->card, kcontrol)) < 0) 880 err = snd_ctl_add(vortex->card, kcontrol); 881 if (err < 0) 881 882 return err; 882 883 883 884 /* EQ gain controls */ 884 885 for (i = 0; i < 10; i++) { 885 if ((kcontrol =886 snd_ctl_new1(&vortex_eq_kcontrol, vortex)) == NULL)886 kcontrol = snd_ctl_new1(&vortex_eq_kcontrol, vortex); 887 if (!kcontrol) 887 888 return -ENOMEM; 888 889 snprintf(kcontrol->id.name, sizeof(kcontrol->id.name), 889 890 "%s Playback Volume", EqBandLabels[i]); 890 891 kcontrol->private_value = i; 891 if ((err = snd_ctl_add(vortex->card, kcontrol)) < 0) 892 err = snd_ctl_add(vortex->card, kcontrol); 893 if (err < 0) 892 894 return err; 893 895 //vortex->eqctrl[i] = kcontrol; 894 896 } 895 897 /* EQ band levels */ 896 if ((kcontrol = snd_ctl_new1(&vortex_levels_kcontrol, vortex)) == NULL) 898 kcontrol = snd_ctl_new1(&vortex_levels_kcontrol, vortex); 899 if (!kcontrol) 897 900 return -ENOMEM; 898 if ((err = snd_ctl_add(vortex->card, kcontrol)) < 0) 901 err = snd_ctl_add(vortex->card, kcontrol); 902 if (err < 0) 899 903 return err; 900 904 -
GPL/trunk/alsa-kernel/pci/au88x0/au88x0_mixer.c
r679 r703 31 31 }; 32 32 33 if ((err = snd_ac97_bus(vortex->card, 0, &ops, NULL, &pbus)) < 0) 33 err = snd_ac97_bus(vortex->card, 0, &ops, NULL, &pbus); 34 if (err < 0) 34 35 return err; 35 36 memset(&ac97, 0, sizeof(ac97)); -
GPL/trunk/alsa-kernel/pci/au88x0/au88x0_mpu401.c
r679 r703 69 69 /* Create MPU401 instance. */ 70 70 #ifdef VORTEX_MPU401_LEGACY 71 if ((temp =72 snd_mpu401_uart_new(vortex->card, 0, MPU401_HW_MPU401, 0x330,73 MPU401_INFO_IRQ_HOOK, -1, &rmidi)) != 0) {71 temp = snd_mpu401_uart_new(vortex->card, 0, MPU401_HW_MPU401, 0x330, 72 MPU401_INFO_IRQ_HOOK, -1, &rmidi); 73 if (temp) { 74 74 hwwrite(vortex->mmio, VORTEX_CTRL, 75 75 (hwread(vortex->mmio, VORTEX_CTRL) & … … 79 79 #else 80 80 port = (unsigned long)(vortex->mmio + VORTEX_MIDI_DATA); 81 if ((temp =82 snd_mpu401_uart_new(vortex->card, 0, MPU401_HW_AUREAL, port,83 MPU401_INFO_INTEGRATED | MPU401_INFO_MMIO |84 MPU401_INFO_IRQ_HOOK, -1, &rmidi)) != 0) {81 temp = snd_mpu401_uart_new(vortex->card, 0, MPU401_HW_AUREAL, port, 82 MPU401_INFO_INTEGRATED | MPU401_INFO_MMIO | 83 MPU401_INFO_IRQ_HOOK, -1, &rmidi); 84 if (temp) { 85 85 hwwrite(vortex->mmio, VORTEX_CTRL, 86 86 (hwread(vortex->mmio, VORTEX_CTRL) & -
GPL/trunk/alsa-kernel/pci/au88x0/au88x0_pcm.c
r679 r703 131 131 132 132 /* Force equal size periods */ 133 if ((err =134 snd_pcm_hw_constraint_integer(runtime,135 SNDRV_PCM_HW_PARAM_PERIODS))< 0)133 err = snd_pcm_hw_constraint_integer(runtime, 134 SNDRV_PCM_HW_PARAM_PERIODS); 135 if (err < 0) 136 136 return err; 137 137 /* Avoid PAGE_SIZE boundary to fall inside of a period. */ 138 if ((err =139 snd_pcm_hw_constraint_pow2(runtime, 0,140 SNDRV_PCM_HW_PARAM_PERIOD_BYTES))< 0)138 err = snd_pcm_hw_constraint_pow2(runtime, 0, 139 SNDRV_PCM_HW_PARAM_PERIOD_BYTES); 140 if (err < 0) 141 141 return err; 142 142 … … 659 659 if (!kctl) 660 660 return -ENOMEM; 661 if ((err = snd_ctl_add(chip->card, kctl)) < 0) 661 err = snd_ctl_add(chip->card, kctl); 662 if (err < 0) 662 663 return err; 663 664 } -
GPL/trunk/alsa-kernel/pci/azt3328.c
r695 r703 1195 1195 for (idx = 0; idx < ARRAY_SIZE(snd_azf3328_mixer_controls); 1196 1196 ++idx, ++sw) { 1197 if ((err = snd_ctl_add(chip->card, snd_ctl_new1(sw, chip))) < 0) 1197 err = snd_ctl_add(chip->card, snd_ctl_new1(sw, chip)); 1198 if (err < 0) 1198 1199 return err; 1199 1200 } -
GPL/trunk/alsa-kernel/pci/bt87x.c
r695 r703 729 729 spin_lock_init(&chip->reg_lock); 730 730 731 if ((err = pci_request_regions(pci, "Bt87x audio")) < 0) { 731 err = pci_request_regions(pci, "Bt87x audio"); 732 if (err < 0) { 732 733 kfree(chip); 733 734 pci_disable_device(pci); -
GPL/trunk/alsa-kernel/pci/ca0106/ca0106_main.c
r695 r703 580 580 //channel->interrupt = snd_ca0106_pcm_channel_interrupt; 581 581 channel->epcm = epcm; 582 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 582 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 583 if (err < 0) 583 584 return err; 584 if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0) 585 err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64); 586 if (err < 0) 585 587 return err; 586 588 snd_pcm_set_sync(substream); … … 673 675 //channel->interrupt = snd_ca0106_pcm_channel_interrupt; 674 676 channel->epcm = epcm; 675 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 677 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 678 if (err < 0) 676 679 return err; 677 680 //snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_capture_period_sizes); 678 if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0) 681 err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64); 682 if (err < 0) 679 683 return err; 680 684 return 0; … … 1171 1175 }; 1172 1176 1173 if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0) 1177 err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus); 1178 if (err < 0) 1174 1179 return err; 1175 1180 pbus->no_vra = 1; /* we don't need VRA */ … … 1764 1769 midi->dev_id = chip; 1765 1770 1766 if ((err = ca_midi_init(chip, midi, 0, name)) < 0) 1771 err = ca_midi_init(chip, midi, 0, name); 1772 if (err < 0) 1767 1773 return err; 1768 1774 -
GPL/trunk/alsa-kernel/pci/ca0106/ca_midi.c
r679 r703 277 277 int err; 278 278 279 if ((err = snd_rawmidi_new(midi->get_dev_id_card(midi->dev_id), name, device, 1, 1, &rmidi)) < 0) 279 err = snd_rawmidi_new(midi->get_dev_id_card(midi->dev_id), name, device, 1, 1, &rmidi); 280 if (err < 0) 280 281 return err; 281 282 -
GPL/trunk/alsa-kernel/pci/cmipci.c
r695 r703 1235 1235 rate = subs->runtime->rate; 1236 1236 1237 if (up && do_ac3) 1238 if ((err = save_mixer_state(cm)) < 0) 1237 if (up && do_ac3) { 1238 err = save_mixer_state(cm); 1239 if (err < 0) 1239 1240 return err; 1241 } 1240 1242 1241 1243 spin_lock_irq(&cm->reg_lock); … … 1286 1288 if (do_spdif && cm->can_ac3_hw) 1287 1289 do_ac3 = cm->dig_pcm_status & IEC958_AES0_NONAUDIO; 1288 if ((err = setup_spdif_playback(cm, substream, do_spdif, do_ac3)) < 0) 1290 err = setup_spdif_playback(cm, substream, do_spdif, do_ac3); 1291 if (err < 0) 1289 1292 return err; 1290 1293 return snd_cmipci_pcm_prepare(cm, &cm->channel[CM_CH_PLAY], substream); … … 1301 1304 else 1302 1305 do_ac3 = 1; /* doesn't matter */ 1303 if ((err = setup_spdif_playback(cm, substream, 1, do_ac3)) < 0) 1306 err = setup_spdif_playback(cm, substream, 1, do_ac3); 1307 if (err < 0) 1304 1308 return err; 1305 1309 return snd_cmipci_pcm_prepare(cm, &cm->channel[CM_CH_PLAY], substream); … … 1649 1653 int err; 1650 1654 1651 if ((err = open_device_check(cm, CM_OPEN_PLAYBACK, substream)) < 0) 1655 err = open_device_check(cm, CM_OPEN_PLAYBACK, substream); 1656 if (err < 0) 1652 1657 return err; 1653 1658 runtime->hw = snd_cmipci_playback; … … 1675 1680 int err; 1676 1681 1677 if ((err = open_device_check(cm, CM_OPEN_CAPTURE, substream)) < 0) 1682 err = open_device_check(cm, CM_OPEN_CAPTURE, substream); 1683 if (err < 0) 1678 1684 return err; 1679 1685 runtime->hw = snd_cmipci_capture; … … 1699 1705 int err; 1700 1706 1701 if ((err = open_device_check(cm, CM_OPEN_PLAYBACK2, substream)) < 0) /* use channel B */ 1707 /* use channel B */ 1708 err = open_device_check(cm, CM_OPEN_PLAYBACK2, substream); 1709 if (err < 0) 1702 1710 return err; 1703 1711 runtime->hw = snd_cmipci_playback2; … … 1737 1745 int err; 1738 1746 1739 if ((err = open_device_check(cm, CM_OPEN_SPDIF_PLAYBACK, substream)) < 0) /* use channel A */ 1747 /* use channel A */ 1748 err = open_device_check(cm, CM_OPEN_SPDIF_PLAYBACK, substream); 1749 if (err < 0) 1740 1750 return err; 1741 1751 if (cm->can_ac3_hw) { … … 1764 1774 int err; 1765 1775 1766 if ((err = open_device_check(cm, CM_OPEN_SPDIF_CAPTURE, substream)) < 0) /* use channel B */ 1776 /* use channel B */ 1777 err = open_device_check(cm, CM_OPEN_SPDIF_CAPTURE, substream); 1778 if (err < 0) 1767 1779 return err; 1768 1780 runtime->hw = snd_cmipci_capture_spdif; … … 2671 2683 continue; 2672 2684 } 2673 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_cmipci_mixers[idx], cm))) < 0) 2685 err = snd_ctl_add(card, snd_ctl_new1(&snd_cmipci_mixers[idx], cm)); 2686 if (err < 0) 2674 2687 return err; 2675 2688 } … … 2696 2709 } 2697 2710 if (cm->can_ac3_hw) { 2698 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_cmipci_spdif_default, cm))) < 0) 2711 kctl = snd_ctl_new1(&snd_cmipci_spdif_default, cm); 2712 err = snd_ctl_add(card, kctl); 2713 if (err < 0) 2699 2714 return err; 2700 2715 kctl->id.device = pcm_spdif_device; 2701 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_cmipci_spdif_mask, cm))) < 0) 2716 kctl = snd_ctl_new1(&snd_cmipci_spdif_mask, cm); 2717 err = snd_ctl_add(card, kctl); 2718 if (err < 0) 2702 2719 return err; 2703 2720 kctl->id.device = pcm_spdif_device; 2704 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_cmipci_spdif_stream, cm))) < 0) 2721 kctl = snd_ctl_new1(&snd_cmipci_spdif_stream, cm); 2722 err = snd_ctl_add(card, kctl); 2723 if (err < 0) 2705 2724 return err; 2706 2725 kctl->id.device = pcm_spdif_device; … … 2976 2995 } 2977 2996 } 2978 if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 2997 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 2998 if (err < 0) { 2979 2999 dev_err(cm->card->dev, "cannot create OPL3 hwdep\n"); 2980 3000 return err; … … 3008 3028 *rcmipci = NULL; 3009 3029 3010 if ((err = pci_enable_device(pci)) < 0) 3030 err = pci_enable_device(pci); 3031 if (err < 0) 3011 3032 return err; 3012 3033 … … 3027 3048 cm->channel[0].is_dac = cm->channel[1].is_dac = 1; /* dual DAC mode */ 3028 3049 3029 if ((err = pci_request_regions(pci, card->driver)) < 0) { 3050 err = pci_request_regions(pci, card->driver); 3051 if (err < 0) { 3030 3052 kfree(cm); 3031 3053 pci_disable_device(pci); … … 3141 3163 card->shortname, modelstr, cm->iobase, cm->irq); 3142 3164 3143 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, cm, &ops)) < 0) { 3165 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, cm, &ops); 3166 if (err < 0) { 3144 3167 snd_cmipci_free(cm); 3145 3168 return err; … … 3193 3216 /* create pcm devices */ 3194 3217 pcm_index = pcm_spdif_index = 0; 3195 if ((err = snd_cmipci_pcm_new(cm, pcm_index)) < 0) 3218 err = snd_cmipci_pcm_new(cm, pcm_index); 3219 if (err < 0) 3196 3220 return err; 3197 3221 pcm_index++; 3198 if ((err = snd_cmipci_pcm2_new(cm, pcm_index)) < 0) 3222 err = snd_cmipci_pcm2_new(cm, pcm_index); 3223 if (err < 0) 3199 3224 return err; 3200 3225 pcm_index++; 3201 3226 if (cm->can_ac3_hw || cm->can_ac3_sw) { 3202 3227 pcm_spdif_index = pcm_index; 3203 if ((err = snd_cmipci_pcm_spdif_new(cm, pcm_index)) < 0) 3228 err = snd_cmipci_pcm_spdif_new(cm, pcm_index); 3229 if (err < 0) 3204 3230 return err; 3205 3231 } 3206 3232 3207 3233 /* create mixer interface & switches */ 3208 if ((err = snd_cmipci_mixer_new(cm, pcm_spdif_index)) < 0) 3234 err = snd_cmipci_mixer_new(cm, pcm_spdif_index); 3235 if (err < 0) 3209 3236 return err; 3210 3237 3211 3238 if (iomidi > 0) { 3212 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_CMIPCI, 3213 iomidi, 3214 (integrated_midi ? 3215 MPU401_INFO_INTEGRATED : 0) | 3216 MPU401_INFO_IRQ_HOOK, 3217 -1, &cm->rmidi)) < 0) { 3239 err = snd_mpu401_uart_new(card, 0, MPU401_HW_CMIPCI, 3240 iomidi, 3241 (integrated_midi ? 3242 MPU401_INFO_INTEGRATED : 0) | 3243 MPU401_INFO_IRQ_HOOK, 3244 -1, &cm->rmidi); 3245 if (err < 0) 3218 3246 dev_err(cm->card->dev, 3219 3247 "no UART401 device at 0x%lx\n", iomidi); 3220 }3221 3248 } 3222 3249 -
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; -
GPL/trunk/alsa-kernel/pci/cs46xx/cs46xx.c
r695 r703 78 78 if (err < 0) 79 79 return err; 80 if ((err = snd_cs46xx_create(card, pci, 81 external_amp[dev], thinkpad[dev], 82 &chip)) < 0) { 80 err = snd_cs46xx_create(card, pci, 81 external_amp[dev], thinkpad[dev], 82 &chip); 83 if (err < 0) { 83 84 snd_card_free(card); 84 85 return err; … … 86 87 card->private_data = chip; 87 88 chip->accept_valid = mmap_valid[dev]; 88 if ((err = snd_cs46xx_pcm(chip, 0)) < 0) { 89 err = snd_cs46xx_pcm(chip, 0); 90 if (err < 0) { 89 91 snd_card_free(card); 90 92 return err; 91 93 } 92 94 #ifdef CONFIG_SND_CS46XX_NEW_DSP 93 if ((err = snd_cs46xx_pcm_rear(chip, 1)) < 0) { 95 err = snd_cs46xx_pcm_rear(chip, 1); 96 if (err < 0) { 94 97 snd_card_free(card); 95 98 return err; 96 99 } 97 if ((err = snd_cs46xx_pcm_iec958(chip, 2)) < 0) { 100 err = snd_cs46xx_pcm_iec958(chip, 2); 101 if (err < 0) { 98 102 snd_card_free(card); 99 103 return err; 100 104 } 101 105 #endif 102 if ((err = snd_cs46xx_mixer(chip, 2)) < 0) { 106 err = snd_cs46xx_mixer(chip, 2); 107 if (err < 0) { 103 108 snd_card_free(card); 104 109 return err; … … 106 111 #ifdef CONFIG_SND_CS46XX_NEW_DSP 107 112 if (chip->nr_ac97_codecs ==2) { 108 if ((err = snd_cs46xx_pcm_center_lfe(chip, 3)) < 0) { 113 err = snd_cs46xx_pcm_center_lfe(chip, 3); 114 if (err < 0) { 109 115 snd_card_free(card); 110 116 return err; … … 112 118 } 113 119 #endif 114 if ((err = snd_cs46xx_midi(chip, 0)) < 0) { 120 err = snd_cs46xx_midi(chip, 0); 121 if (err < 0) { 115 122 snd_card_free(card); 116 123 return err; 117 124 } 118 if ((err = snd_cs46xx_start_dsp(chip)) < 0) { 125 err = snd_cs46xx_start_dsp(chip); 126 if (err < 0) { 119 127 snd_card_free(card); 120 128 return err; … … 132 140 chip->irq); 133 141 134 if ((err = snd_card_register(card)) < 0) { 142 err = snd_card_register(card); 143 if (err < 0) { 135 144 snd_card_free(card); 136 145 return err; -
GPL/trunk/alsa-kernel/pci/cs46xx/cs46xx_lib.c
r695 r703 1063 1063 cs46xx_dsp_destroy_pcm_channel (chip,cpcm->pcm_channel); 1064 1064 1065 if ( (cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate, cpcm, 1066 cpcm->hw_buf.addr, 1067 cpcm->pcm_channel_id)) == NULL) { 1065 cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel(chip, sample_rate, cpcm, 1066 cpcm->hw_buf.addr, 1067 cpcm->pcm_channel_id); 1068 if (!cpcm->pcm_channel) { 1068 1069 dev_err(chip->card->dev, 1069 1070 "failed to re-create virtual PCM channel\n"); … … 1152 1153 runtime->dma_bytes = 0; 1153 1154 } 1154 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) { 1155 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 1156 if (err < 0) { 1155 1157 #ifdef CONFIG_SND_CS46XX_NEW_DSP 1156 1158 mutex_unlock(&chip->spos_mutex); … … 1300 1302 runtime->dma_bytes = 0; 1301 1303 } 1302 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) 1304 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 1305 if (err < 0) 1303 1306 return err; 1304 1307 substream->ops = &snd_cs46xx_capture_indirect_ops; … … 1765 1768 int err; 1766 1769 1767 if ((err = snd_pcm_new(chip->card, "CS46xx", device, MAX_PLAYBACK_CHANNELS, 1, &pcm)) < 0) 1770 err = snd_pcm_new(chip->card, "CS46xx", device, MAX_PLAYBACK_CHANNELS, 1, &pcm); 1771 if (err < 0) 1768 1772 return err; 1769 1773 … … 1792 1796 int err; 1793 1797 1794 if ((err = snd_pcm_new(chip->card, "CS46xx - Rear", device, MAX_PLAYBACK_CHANNELS, 0, &pcm)) < 0) 1798 err = snd_pcm_new(chip->card, "CS46xx - Rear", device, MAX_PLAYBACK_CHANNELS, 0, &pcm); 1799 if (err < 0) 1795 1800 return err; 1796 1801 … … 1816 1821 int err; 1817 1822 1818 if ((err = snd_pcm_new(chip->card, "CS46xx - Center LFE", device, MAX_PLAYBACK_CHANNELS, 0, &pcm)) < 0) 1823 err = snd_pcm_new(chip->card, "CS46xx - Center LFE", device, MAX_PLAYBACK_CHANNELS, 0, &pcm); 1824 if (err < 0) 1819 1825 return err; 1820 1826 … … 1840 1846 int err; 1841 1847 1842 if ((err = snd_pcm_new(chip->card, "CS46xx - IEC958", device, 1, 0, &pcm)) < 0) 1848 err = snd_pcm_new(chip->card, "CS46xx - IEC958", device, 1, 0, &pcm); 1849 if (err < 0) 1843 1850 return err; 1844 1851 … … 2419 2426 /* test if we can write to the record gain volume register */ 2420 2427 snd_ac97_write(ac97, AC97_REC_GAIN, 0x8a05); 2421 if ((err = snd_ac97_read(ac97, AC97_REC_GAIN)) == 0x8a05) 2428 err = snd_ac97_read(ac97, AC97_REC_GAIN); 2429 if (err == 0x8a05) 2422 2430 return; 2423 2431 … … 2481 2489 chip->nr_ac97_codecs = 0; 2482 2490 dev_dbg(chip->card->dev, "detecting primary codec\n"); 2483 if ((err = snd_ac97_bus(card, 0, &ops, chip, &chip->ac97_bus)) < 0) 2491 err = snd_ac97_bus(card, 0, &ops, chip, &chip->ac97_bus); 2492 if (err < 0) 2484 2493 return err; 2485 2494 chip->ac97_bus->private_free = snd_cs46xx_mixer_free_ac97_bus; … … 2502 2511 if (kctl && kctl->id.iface == SNDRV_CTL_ELEM_IFACE_PCM) 2503 2512 kctl->id.device = spdif_device; 2504 if ((err = snd_ctl_add(card, kctl)) < 0) 2513 err = snd_ctl_add(card, kctl); 2514 if (err < 0) 2505 2515 return err; 2506 2516 } … … 2689 2699 int err; 2690 2700 2691 if ((err = snd_rawmidi_new(chip->card, "CS46XX", device, 1, 1, &rmidi)) < 0) 2701 err = snd_rawmidi_new(chip->card, "CS46XX", device, 1, 1, &rmidi); 2702 if (err < 0) 2692 2703 return err; 2693 2704 strcpy(rmidi->name, "CS46XX"); … … 3531 3542 3532 3543 kctl = snd_ctl_new1(&snd_hercules_controls[idx], chip); 3533 if ((err = snd_ctl_add(card, kctl)) < 0) { 3544 err = snd_ctl_add(card, kctl); 3545 if (err < 0) { 3534 3546 dev_err(card->dev, 3535 3547 "failed to initialize Hercules mixer (%d)\n", … … 3876 3888 3877 3889 /* enable PCI device */ 3878 if ((err = pci_enable_device(pci)) < 0) 3890 err = pci_enable_device(pci); 3891 if (err < 0) 3879 3892 return err; 3880 3893 … … 3970 3983 for (idx = 0; idx < 5; idx++) { 3971 3984 region = &chip->region.idx[idx]; 3972 if ((region->resource = request_mem_region(region->base, region->size, 3973 region->name)) == NULL) { 3985 region->resource = request_mem_region(region->base, region->size, 3986 region->name); 3987 if (!region->resource) { 3974 3988 dev_err(chip->card->dev, 3975 3989 "unable to request memory region 0x%lx-0x%lx\n", … … 4010 4024 } 4011 4025 4012 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 4026 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 4027 if (err < 0) { 4013 4028 snd_cs46xx_free(chip); 4014 4029 return err; -
GPL/trunk/alsa-kernel/pci/cs46xx/dsp_spos.c
r679 r703 618 618 } 619 619 620 if ( (symbol = cs46xx_dsp_lookup_symbol_addr (chip,i / sizeof(u32), SYMBOL_PARAMETER)) != NULL) { 620 symbol = cs46xx_dsp_lookup_symbol_addr(chip, i / sizeof(u32), SYMBOL_PARAMETER); 621 if (symbol) { 621 622 col = 0; 622 623 snd_iprintf (buffer,"\n%s:\n",symbol->symbol_name); -
GPL/trunk/alsa-kernel/pci/cs5535audio/cs5535audio.c
r695 r703 148 148 }; 149 149 150 if ((err = snd_ac97_bus(card, 0, &ops, NULL, &pbus)) < 0) 150 err = snd_ac97_bus(card, 0, &ops, NULL, &pbus); 151 if (err < 0) 151 152 return err; 152 153 … … 160 161 olpc_prequirks(card, &ac97); 161 162 162 if ((err = snd_ac97_mixer(pbus, &ac97, &cs5535au->ac97)) < 0) { 163 err = snd_ac97_mixer(pbus, &ac97, &cs5535au->ac97); 164 if (err < 0) { 163 165 dev_err(card->dev, "mixer failed\n"); 164 166 return err; … … 271 273 272 274 *rcs5535au = NULL; 273 if ((err = pci_enable_device(pci)) < 0) 275 err = pci_enable_device(pci); 276 if (err < 0) 274 277 return err; 275 278 … … 291 294 cs5535au->irq = -1; 292 295 293 if ((err = pci_request_regions(pci, "CS5535 Audio")) < 0) { 296 err = pci_request_regions(pci, "CS5535 Audio"); 297 if (err < 0) { 294 298 kfree(cs5535au); 295 299 goto pcifail; … … 309 313 pci_set_master(pci); 310 314 311 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,312 cs5535au, &ops))< 0)315 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, cs5535au, &ops); 316 if (err < 0) 313 317 goto sndfail; 314 318 … … 345 349 return err; 346 350 347 if ((err = snd_cs5535audio_create(card, pci, &cs5535au)) < 0) 351 err = snd_cs5535audio_create(card, pci, &cs5535au); 352 if (err < 0) 348 353 goto probefail_out; 349 354 350 355 card->private_data = cs5535au; 351 356 352 if ((err = snd_cs5535audio_mixer(cs5535au)) < 0) 357 err = snd_cs5535audio_mixer(cs5535au); 358 if (err < 0) 353 359 goto probefail_out; 354 360 355 if ((err = snd_cs5535audio_pcm(cs5535au)) < 0) 361 err = snd_cs5535audio_pcm(cs5535au); 362 if (err < 0) 356 363 goto probefail_out; 357 364 … … 363 370 cs5535au->port, cs5535au->irq); 364 371 365 if ((err = snd_card_register(card)) < 0) 372 err = snd_card_register(card); 373 if (err < 0) 366 374 goto probefail_out; 367 375 -
GPL/trunk/alsa-kernel/pci/cs5535audio/cs5535audio_pcm.c
r679 r703 88 88 cs5535au->playback_substream = substream; 89 89 runtime->private_data = &(cs5535au->dmas[CS5535AUDIO_DMA_PLAYBACK]); 90 if ((err = snd_pcm_hw_constraint_integer(runtime, 91 SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 90 err = snd_pcm_hw_constraint_integer(runtime, 91 SNDRV_PCM_HW_PARAM_PERIODS); 92 if (err < 0) 92 93 return err; 93 94 … … 343 344 cs5535au->capture_substream = substream; 344 345 runtime->private_data = &(cs5535au->dmas[CS5535AUDIO_DMA_CAPTURE]); 345 if ((err = snd_pcm_hw_constraint_integer(runtime, 346 SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 346 err = snd_pcm_hw_constraint_integer(runtime, 347 SNDRV_PCM_HW_PARAM_PERIODS); 348 if (err < 0) 347 349 return err; 348 350 olpc_capture_open(cs5535au->ac97); -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1.c
r695 r703 122 122 else if (max_buffer_size[dev] > 1024) 123 123 max_buffer_size[dev] = 1024; 124 if ((err = snd_emu10k1_create(card, pci, extin[dev], extout[dev], 125 (long)max_buffer_size[dev] * 1024 * 1024, 126 enable_ir[dev], subsystem[dev], 127 &emu)) < 0) 124 err = snd_emu10k1_create(card, pci, extin[dev], extout[dev], 125 (long)max_buffer_size[dev] * 1024 * 1024, 126 enable_ir[dev], subsystem[dev], 127 &emu); 128 if (err < 0) 128 129 goto error; 129 130 card->private_data = emu; 130 131 emu->delay_pcm_irq = delay_pcm_irq[dev] & 0x1f; 131 if ((err = snd_emu10k1_pcm(emu, 0)) < 0) 132 goto error; 133 if ((err = snd_emu10k1_pcm_mic(emu, 1)) < 0) 134 goto error; 135 if ((err = snd_emu10k1_pcm_efx(emu, 2)) < 0) 132 err = snd_emu10k1_pcm(emu, 0); 133 if (err < 0) 134 goto error; 135 err = snd_emu10k1_pcm_mic(emu, 1); 136 if (err < 0) 137 goto error; 138 err = snd_emu10k1_pcm_efx(emu, 2); 139 if (err < 0) 136 140 goto error; 137 141 /* This stores the periods table. */ … … 143 147 } 144 148 145 if ((err = snd_emu10k1_mixer(emu, 0, 3)) < 0) 149 err = snd_emu10k1_mixer(emu, 0, 3); 150 if (err < 0) 146 151 goto error; 147 152 148 if ((err = snd_emu10k1_timer(emu, 0)) < 0) 149 goto error; 150 151 if ((err = snd_emu10k1_pcm_multi(emu, 3)) < 0) 153 err = snd_emu10k1_timer(emu, 0); 154 if (err < 0) 155 goto error; 156 157 err = snd_emu10k1_pcm_multi(emu, 3); 158 if (err < 0) 152 159 goto error; 153 160 if (emu->card_capabilities->ca0151_chip) { /* P16V */ 154 if ((err = snd_p16v_pcm(emu, 4)) < 0) 161 err = snd_p16v_pcm(emu, 4); 162 if (err < 0) 155 163 goto error; 156 164 } 157 165 if (emu->audigy) { 158 if ((err = snd_emu10k1_audigy_midi(emu)) < 0) 166 err = snd_emu10k1_audigy_midi(emu); 167 if (err < 0) 159 168 goto error; 160 169 } else { 161 if ((err = snd_emu10k1_midi(emu)) < 0) 162 goto error; 163 } 164 if ((err = snd_emu10k1_fx8010_new(emu, 0)) < 0) 170 err = snd_emu10k1_midi(emu); 171 if (err < 0) 172 goto error; 173 } 174 err = snd_emu10k1_fx8010_new(emu, 0); 175 if (err < 0) 165 176 goto error; 166 177 #ifdef ENABLE_SYNTH … … 189 200 card->shortname, emu->revision, emu->serial, emu->port, emu->irq); 190 201 191 if ((err = snd_card_register(card)) < 0) 202 err = snd_card_register(card); 203 if (err < 0) 192 204 goto error; 193 205 -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_callback.c
r679 r703 91 91 int ch; 92 92 vp = &emu->voices[best[i].voice]; 93 if ((ch = vp->ch) < 0) { 93 ch = vp->ch; 94 if (ch < 0) { 94 95 /* 95 96 dev_warn(emu->card->dev, -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1x.c
r695 r703 353 353 struct emu10k1x_pcm *epcm; 354 354 355 if ((epcm = voice->epcm) == NULL) 355 epcm = voice->epcm; 356 if (!epcm) 356 357 return; 357 358 if (epcm->substream == NULL) … … 375 376 int err; 376 377 377 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) { 378 return err; 379 } 380 if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0) 378 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 379 if (err < 0) 380 return err; 381 err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64); 382 if (err < 0) 381 383 return err; 382 384 … … 554 556 int err; 555 557 556 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 557 return err; 558 if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0) 559 return err; 558 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 559 if (err < 0) 560 return err; 561 err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64); 562 if (err < 0) 563 return err; 560 564 561 565 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); … … 726 730 }; 727 731 728 if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0) 732 err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus); 733 if (err < 0) 729 734 return err; 730 735 pbus->no_vra = 1; /* we don't need VRA */ … … 842 847 capture = 1; 843 848 844 if ((err = snd_pcm_new(emu->card, "emu10k1x", device, 1, capture, &pcm)) < 0) 849 err = snd_pcm_new(emu->card, "emu10k1x", device, 1, capture, &pcm); 850 if (err < 0) 845 851 return err; 846 852 … … 895 901 *rchip = NULL; 896 902 897 if ((err = pci_enable_device(pci)) < 0) 903 err = pci_enable_device(pci); 904 if (err < 0) 898 905 return err; 899 906 … … 918 925 919 926 chip->port = pci_resource_start(pci, 0); 920 if ((chip->res_port = request_region(chip->port, 8,921 "EMU10K1X")) == NULL) {927 chip->res_port = request_region(chip->port, 8, "EMU10K1X"); 928 if (!chip->res_port) { 922 929 dev_err(card->dev, "cannot allocate the port 0x%lx\n", 923 930 chip->port); … … 999 1006 outl(HCFG_LOCKSOUNDCACHE|HCFG_AUDIOENABLE, chip->port+HCFG); 1000 1007 1001 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,1002 chip, &ops))< 0) {1008 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 1009 if (err < 0) { 1003 1010 snd_emu10k1x_free(chip); 1004 1011 return err; … … 1179 1186 struct snd_card *card = emu->card; 1180 1187 1181 if ((kctl = snd_ctl_new1(&snd_emu10k1x_spdif_mask_control, emu)) == NULL) 1188 kctl = snd_ctl_new1(&snd_emu10k1x_spdif_mask_control, emu); 1189 if (!kctl) 1182 1190 return -ENOMEM; 1183 if ((err = snd_ctl_add(card, kctl))) 1184 return err; 1185 if ((kctl = snd_ctl_new1(&snd_emu10k1x_shared_spdif, emu)) == NULL) 1191 err = snd_ctl_add(card, kctl); 1192 if (err) 1193 return err; 1194 kctl = snd_ctl_new1(&snd_emu10k1x_shared_spdif, emu); 1195 if (!kctl) 1186 1196 return -ENOMEM; 1187 if ((err = snd_ctl_add(card, kctl))) 1188 return err; 1189 if ((kctl = snd_ctl_new1(&snd_emu10k1x_spdif_control, emu)) == NULL) 1197 err = snd_ctl_add(card, kctl); 1198 if (err) 1199 return err; 1200 kctl = snd_ctl_new1(&snd_emu10k1x_spdif_control, emu); 1201 if (!kctl) 1190 1202 return -ENOMEM; 1191 if ((err = snd_ctl_add(card, kctl))) 1203 err = snd_ctl_add(card, kctl); 1204 if (err) 1192 1205 return err; 1193 1206 … … 1496 1509 int err; 1497 1510 1498 if ((err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi)) < 0) 1511 err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi); 1512 if (err < 0) 1499 1513 return err; 1500 1514 midi->emu = emu; … … 1519 1533 int err; 1520 1534 1521 if ((err = emu10k1x_midi_init(emu, midi, 0, "EMU10K1X MPU-401 (UART)")) < 0) 1535 err = emu10k1x_midi_init(emu, midi, 0, "EMU10K1X MPU-401 (UART)"); 1536 if (err < 0) 1522 1537 return err; 1523 1538 … … 1551 1566 return err; 1552 1567 1553 if ((err = snd_emu10k1x_create(card, pci, &chip)) < 0) { 1568 err = snd_emu10k1x_create(card, pci, &chip); 1569 if (err < 0) { 1554 1570 snd_card_free(card); 1555 1571 return err; 1556 1572 } 1557 1573 1558 if ((err = snd_emu10k1x_pcm(chip, 0)) < 0) { 1574 err = snd_emu10k1x_pcm(chip, 0); 1575 if (err < 0) { 1559 1576 snd_card_free(card); 1560 1577 return err; 1561 1578 } 1562 if ((err = snd_emu10k1x_pcm(chip, 1)) < 0) { 1579 err = snd_emu10k1x_pcm(chip, 1); 1580 if (err < 0) { 1563 1581 snd_card_free(card); 1564 1582 return err; 1565 1583 } 1566 if ((err = snd_emu10k1x_pcm(chip, 2)) < 0) { 1584 err = snd_emu10k1x_pcm(chip, 2); 1585 if (err < 0) { 1567 1586 snd_card_free(card); 1568 1587 return err; 1569 1588 } 1570 1589 1571 if ((err = snd_emu10k1x_ac97(chip)) < 0) { 1590 err = snd_emu10k1x_ac97(chip); 1591 if (err < 0) { 1572 1592 snd_card_free(card); 1573 1593 return err; 1574 1594 } 1575 1595 1576 if ((err = snd_emu10k1x_mixer(chip)) < 0) { 1596 err = snd_emu10k1x_mixer(chip); 1597 if (err < 0) { 1577 1598 snd_card_free(card); 1578 1599 return err; 1579 1600 } 1580 1601 1581 if ((err = snd_emu10k1x_midi(chip)) < 0) { 1602 err = snd_emu10k1x_midi(chip); 1603 if (err < 0) { 1582 1604 snd_card_free(card); 1583 1605 return err; … … 1591 1613 card->shortname, chip->port, chip->irq); 1592 1614 1593 if ((err = snd_card_register(card)) < 0) { 1615 err = snd_card_register(card); 1616 if (err < 0) { 1594 1617 snd_card_free(card); 1595 1618 return err; -
GPL/trunk/alsa-kernel/pci/emu10k1/emufx.c
r695 r703 438 438 439 439 spin_lock_irqsave(&emu->fx8010.irq_lock, flags); 440 if ((tmp = emu->fx8010.irq_handlers) == irq) { 440 tmp = emu->fx8010.irq_handlers; 441 if (tmp == irq) { 441 442 emu->fx8010.irq_handlers = tmp->next; 442 443 if (emu->fx8010.irq_handlers == NULL) { … … 873 874 knew.private_value = (unsigned long)ctl; 874 875 *ctl = *nctl; 875 if ((err = snd_ctl_add(emu->card, kctl = snd_ctl_new1(&knew, emu))) < 0) { 876 kctl = snd_ctl_new1(&knew, emu); 877 err = snd_ctl_add(emu->card, kctl); 878 if (err < 0) { 876 879 kfree(ctl); 877 880 kfree(knew.tlv.p); … … 2405 2408 OP(icode, &ptr, iACC3, C_00000000, C_00000000, C_00000000, C_00000000); 2406 2409 2407 if ((err = snd_emu10k1_fx8010_tram_setup(emu, ipcm->buffer_size)) < 0) 2410 err = snd_emu10k1_fx8010_tram_setup(emu, ipcm->buffer_size); 2411 if (err < 0) 2408 2412 goto __err; 2409 2413 icode->gpr_add_control_count = i; … … 2683 2687 int err; 2684 2688 2685 if ((err = snd_hwdep_new(emu->card, "FX8010", device, &hw)) < 0) 2689 err = snd_hwdep_new(emu->card, "FX8010", device, &hw); 2690 if (err < 0) 2686 2691 return err; 2687 2692 strcpy(hw->name, "EMU10K1 (FX8010)"); -
GPL/trunk/alsa-kernel/pci/emu10k1/emumixer.c
r679 r703 1120 1120 tmp = reg & ~A_SPDIF_RATE_MASK; 1121 1121 tmp |= val; 1122 if ((change = (tmp != reg))) 1122 change = (tmp != reg); 1123 if (change) 1123 1124 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, 0, tmp); 1124 1125 spin_unlock_irqrestore(&emu->reg_lock, flags); … … 1904 1905 }; 1905 1906 1906 if ((err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus)) < 0) 1907 err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus); 1908 if (err < 0) 1907 1909 return err; 1908 1910 pbus->no_vra = 1; /* we don't need VRA */ … … 1912 1914 ac97.private_free = snd_emu10k1_mixer_free_ac97; 1913 1915 ac97.scaps = AC97_SCAP_NO_SPDIF; 1914 if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0) { 1916 err = snd_ac97_mixer(pbus, &ac97, &emu->ac97); 1917 if (err < 0) { 1915 1918 if (emu->card_capabilities->ac97_chip == 1) 1916 1919 return err; … … 1992 1995 rename_ctl(card, "Mic Capture Volume", "Unknown1 Capture Volume"); 1993 1996 } 1994 if ((kctl = emu->ctl_send_routing = snd_ctl_new1(&snd_emu10k1_send_routing_control, emu)) == NULL) 1997 kctl = emu->ctl_send_routing = snd_ctl_new1(&snd_emu10k1_send_routing_control, emu); 1998 if (!kctl) 1995 1999 return -ENOMEM; 1996 2000 kctl->id.device = pcm_device; 1997 if ((err = snd_ctl_add(card, kctl))) 2001 err = snd_ctl_add(card, kctl); 2002 if (err) 1998 2003 return err; 1999 if ((kctl = emu->ctl_send_volume = snd_ctl_new1(&snd_emu10k1_send_volume_control, emu)) == NULL) 2004 kctl = emu->ctl_send_volume = snd_ctl_new1(&snd_emu10k1_send_volume_control, emu); 2005 if (!kctl) 2000 2006 return -ENOMEM; 2001 2007 kctl->id.device = pcm_device; 2002 if ((err = snd_ctl_add(card, kctl))) 2008 err = snd_ctl_add(card, kctl); 2009 if (err) 2003 2010 return err; 2004 if ((kctl = emu->ctl_attn = snd_ctl_new1(&snd_emu10k1_attn_control, emu)) == NULL) 2011 kctl = emu->ctl_attn = snd_ctl_new1(&snd_emu10k1_attn_control, emu); 2012 if (!kctl) 2005 2013 return -ENOMEM; 2006 2014 kctl->id.device = pcm_device; 2007 if ((err = snd_ctl_add(card, kctl))) 2015 err = snd_ctl_add(card, kctl); 2016 if (err) 2008 2017 return err; 2009 2018 2010 if ((kctl = emu->ctl_efx_send_routing = snd_ctl_new1(&snd_emu10k1_efx_send_routing_control, emu)) == NULL) 2019 kctl = emu->ctl_efx_send_routing = snd_ctl_new1(&snd_emu10k1_efx_send_routing_control, emu); 2020 if (!kctl) 2011 2021 return -ENOMEM; 2012 2022 kctl->id.device = multi_device; 2013 if ((err = snd_ctl_add(card, kctl))) 2023 err = snd_ctl_add(card, kctl); 2024 if (err) 2014 2025 return err; 2015 2026 2016 if ((kctl = emu->ctl_efx_send_volume = snd_ctl_new1(&snd_emu10k1_efx_send_volume_control, emu)) == NULL) 2027 kctl = emu->ctl_efx_send_volume = snd_ctl_new1(&snd_emu10k1_efx_send_volume_control, emu); 2028 if (!kctl) 2017 2029 return -ENOMEM; 2018 2030 kctl->id.device = multi_device; 2019 if ((err = snd_ctl_add(card, kctl))) 2031 err = snd_ctl_add(card, kctl); 2032 if (err) 2020 2033 return err; 2021 2034 2022 if ((kctl = emu->ctl_efx_attn = snd_ctl_new1(&snd_emu10k1_efx_attn_control, emu)) == NULL) 2035 kctl = emu->ctl_efx_attn = snd_ctl_new1(&snd_emu10k1_efx_attn_control, emu); 2036 if (!kctl) 2023 2037 return -ENOMEM; 2024 2038 kctl->id.device = multi_device; 2025 if ((err = snd_ctl_add(card, kctl))) 2039 err = snd_ctl_add(card, kctl); 2040 if (err) 2026 2041 return err; 2027 2042 … … 2070 2085 if (! emu->card_capabilities->ecard) { /* FIXME: APS has these controls? */ 2071 2086 /* sb live! and audigy */ 2072 if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_mask_control, emu)) == NULL) 2087 kctl = snd_ctl_new1(&snd_emu10k1_spdif_mask_control, emu); 2088 if (!kctl) 2073 2089 return -ENOMEM; 2074 2090 if (!emu->audigy) 2075 2091 kctl->id.device = emu->pcm_efx->device; 2076 if ((err = snd_ctl_add(card, kctl))) 2092 err = snd_ctl_add(card, kctl); 2093 if (err) 2077 2094 return err; 2078 if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_control, emu)) == NULL) 2095 kctl = snd_ctl_new1(&snd_emu10k1_spdif_control, emu); 2096 if (!kctl) 2079 2097 return -ENOMEM; 2080 2098 if (!emu->audigy) 2081 2099 kctl->id.device = emu->pcm_efx->device; 2082 if ((err = snd_ctl_add(card, kctl))) 2100 err = snd_ctl_add(card, kctl); 2101 if (err) 2083 2102 return err; 2084 2103 } … … 2087 2106 ; /* Disable the snd_audigy_spdif_shared_spdif */ 2088 2107 } else if (emu->audigy) { 2089 if ((kctl = snd_ctl_new1(&snd_audigy_shared_spdif, emu)) == NULL) 2108 kctl = snd_ctl_new1(&snd_audigy_shared_spdif, emu); 2109 if (!kctl) 2090 2110 return -ENOMEM; 2091 if ((err = snd_ctl_add(card, kctl))) 2111 err = snd_ctl_add(card, kctl); 2112 if (err) 2092 2113 return err; 2093 2114 #if 0 2094 if ((kctl = snd_ctl_new1(&snd_audigy_spdif_output_rate, emu)) == NULL) 2115 kctl = snd_ctl_new1(&snd_audigy_spdif_output_rate, emu); 2116 if (!kctl) 2095 2117 return -ENOMEM; 2096 if ((err = snd_ctl_add(card, kctl))) 2118 err = snd_ctl_add(card, kctl); 2119 if (err) 2097 2120 return err; 2098 2121 #endif 2099 2122 } else if (! emu->card_capabilities->ecard) { 2100 2123 /* sb live! */ 2101 if ((kctl = snd_ctl_new1(&snd_emu10k1_shared_spdif, emu)) == NULL) 2124 kctl = snd_ctl_new1(&snd_emu10k1_shared_spdif, emu); 2125 if (!kctl) 2102 2126 return -ENOMEM; 2103 if ((err = snd_ctl_add(card, kctl))) 2127 err = snd_ctl_add(card, kctl); 2128 if (err) 2104 2129 return err; 2105 2130 } 2106 2131 if (emu->card_capabilities->ca0151_chip) { /* P16V */ 2107 if ((err = snd_p16v_mixer(emu))) 2132 err = snd_p16v_mixer(emu); 2133 if (err) 2108 2134 return err; 2109 2135 } -
GPL/trunk/alsa-kernel/pci/emu10k1/emumpu401.c
r679 r703 320 320 int err; 321 321 322 if ((err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi)) < 0) 322 err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi); 323 if (err < 0) 323 324 return err; 324 325 midi->emu = emu; … … 343 344 int err; 344 345 345 if ((err = emu10k1_midi_init(emu, midi, 0, "EMU10K1 MPU-401 (UART)")) < 0) 346 err = emu10k1_midi_init(emu, midi, 0, "EMU10K1 MPU-401 (UART)"); 347 if (err < 0) 346 348 return err; 347 349 … … 361 363 362 364 midi = &emu->midi; 363 if ((err = emu10k1_midi_init(emu, midi, 0, "Audigy MPU-401 (UART)")) < 0) 365 err = emu10k1_midi_init(emu, midi, 0, "Audigy MPU-401 (UART)"); 366 if (err < 0) 364 367 return err; 365 368 … … 372 375 373 376 midi = &emu->midi2; 374 if ((err = emu10k1_midi_init(emu, midi, 1, "Audigy MPU-401 #2")) < 0) 377 err = emu10k1_midi_init(emu, midi, 1, "Audigy MPU-401 #2"); 378 if (err < 0) 375 379 return err; 376 380 -
GPL/trunk/alsa-kernel/pci/emu10k1/emupcm.c
r679 r703 26 26 struct snd_emu10k1_pcm *epcm; 27 27 28 if ((epcm = voice->epcm) == NULL) 28 epcm = voice->epcm; 29 if (!epcm) 29 30 return; 30 31 if (epcm->substream == NULL) … … 400 401 int err; 401 402 402 if ((err = snd_emu10k1_pcm_channel_alloc(epcm, params_channels(hw_params))) < 0) 403 err = snd_emu10k1_pcm_channel_alloc(epcm, params_channels(hw_params)); 404 if (err < 0) 403 405 return err; 404 406 … … 1125 1127 runtime->private_free = snd_emu10k1_pcm_free_substream; 1126 1128 runtime->hw = snd_emu10k1_playback; 1127 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) { 1129 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 1130 if (err < 0) { 1128 1131 kfree(epcm); 1129 1132 return err; 1130 1133 } 1131 if ((err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX)) < 0) { 1134 err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX); 1135 if (err < 0) { 1132 1136 kfree(epcm); 1133 1137 return err; … … 1381 1385 int err; 1382 1386 1383 if ((err = snd_pcm_new(emu->card, "emu10k1", device, 32, 1, &pcm)) < 0) 1387 err = snd_pcm_new(emu->card, "emu10k1", device, 32, 1, &pcm); 1388 if (err < 0) 1384 1389 return err; 1385 1390 … … 1413 1418 int err; 1414 1419 1415 if ((err = snd_pcm_new(emu->card, "emu10k1", device, 1, 0, &pcm)) < 0) 1420 err = snd_pcm_new(emu->card, "emu10k1", device, 1, 0, &pcm); 1421 if (err < 0) 1416 1422 return err; 1417 1423 … … 1447 1453 int err; 1448 1454 1449 if ((err = snd_pcm_new(emu->card, "emu10k1 mic", device, 0, 1, &pcm)) < 0) 1455 err = snd_pcm_new(emu->card, "emu10k1 mic", device, 0, 1, &pcm); 1456 if (err < 0) 1450 1457 return err; 1451 1458 … … 1775 1782 int err; 1776 1783 1777 if ((err = snd_pcm_new(emu->card, "emu10k1 efx", device, 8, 1, &pcm)) < 0) 1784 err = snd_pcm_new(emu->card, "emu10k1 efx", device, 8, 1, &pcm); 1785 if (err < 0) 1778 1786 return err; 1779 1787 -
GPL/trunk/alsa-kernel/pci/emu10k1/memory.c
r695 r703 170 170 171 171 /* calculate the expected size of empty region */ 172 if ((p = blk->mapped_link.prev) != &emu->mapped_link_head) { 172 p = blk->mapped_link.prev; 173 if (p != &emu->mapped_link_head) { 173 174 q = get_emu10k1_memblk(p, mapped_link); 174 175 start_page = q->mapped_page + q->pages; 175 } else 176 } else { 176 177 start_page = 1; 177 if ((p = blk->mapped_link.next) != &emu->mapped_link_head) { 178 } 179 p = blk->mapped_link.next; 180 if (p != &emu->mapped_link_head) { 178 181 q = get_emu10k1_memblk(p, mapped_link); 179 182 end_page = q->mapped_page; 180 } else 183 } else { 181 184 end_page = (emu->address_mode ? MAX_ALIGN_PAGES1 : MAX_ALIGN_PAGES0); 185 } 182 186 183 187 /* remove links */ … … 268 272 return 0; 269 273 } 270 if ((err = map_memblk(emu, blk)) < 0) { 274 err = map_memblk(emu, blk); 275 if (err < 0) { 271 276 /* no enough page - try to unmap some blocks */ 272 277 /* starting from the oldest block */ … … 455 460 int first_page, last_page; 456 461 first_page = blk->first_page; 457 if ((p = blk->mem.list.prev) != &hdr->block) { 462 p = blk->mem.list.prev; 463 if (p != &hdr->block) { 458 464 q = get_emu10k1_memblk(p, mem.list); 459 465 if (q->last_page == first_page) … … 461 467 } 462 468 last_page = blk->last_page; 463 if ((p = blk->mem.list.next) != &hdr->block) { 469 p = blk->mem.list.next; 470 if (p != &hdr->block) { 464 471 q = get_emu10k1_memblk(p, mem.list); 465 472 if (q->first_page == last_page) -
GPL/trunk/alsa-kernel/pci/emu10k1/p16v.c
r679 r703 195 195 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */ 196 196 channel->epcm = epcm; 197 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 197 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 198 if (err < 0) 198 199 return err; 199 200 … … 243 244 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */ 244 245 channel->epcm = epcm; 245 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 246 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 247 if (err < 0) 246 248 return err; 247 249 … … 590 592 emu->p16v_device_offset = device; 591 593 592 if ((err = snd_pcm_new(emu->card, "p16v", device, 1, capture, &pcm)) < 0) 594 err = snd_pcm_new(emu->card, "p16v", device, 1, capture, &pcm); 595 if (err < 0) 593 596 return err; 594 597 … … 809 812 810 813 for (i = 0; i < ARRAY_SIZE(p16v_mixer_controls); i++) { 811 if ((err = snd_ctl_add(card, snd_ctl_new1(&p16v_mixer_controls[i],812 emu)))< 0)814 err = snd_ctl_add(card, snd_ctl_new1(&p16v_mixer_controls[i], emu)); 815 if (err < 0) 813 816 return err; 814 817 } -
GPL/trunk/alsa-kernel/pci/emu10k1/timer.c
r679 r703 73 73 tid.device = device; 74 74 tid.subdevice = 0; 75 if ((err = snd_timer_new(emu->card, "EMU10K1", &tid, &timer)) >= 0) { 75 err = snd_timer_new(emu->card, "EMU10K1", &tid, &timer); 76 if (err >= 0) { 76 77 strcpy(timer->name, "EMU10K1 timer"); 77 78 timer->private_data = emu; -
GPL/trunk/alsa-kernel/pci/ens1370.c
r695 r703 676 676 /* now wait for the stinkin' data (RDY) */ 677 677 for (t = 0; t < POLL_COUNT; t++) { 678 if ((x = inl(ES_REG(ensoniq, 1371_CODEC))) & ES_1371_CODEC_RDY) { 678 x = inl(ES_REG(ensoniq, 1371_CODEC)); 679 if (x & ES_1371_CODEC_RDY) { 679 680 if (is_ev1938(ensoniq)) { 680 681 for (t = 0; t < 100; t++) … … 1598 1599 }; 1599 1600 1600 if ((err = snd_ac97_bus(card, 0, &ops, NULL, &pbus)) < 0) 1601 err = snd_ac97_bus(card, 0, &ops, NULL, &pbus); 1602 if (err < 0) 1601 1603 return err; 1602 1604 … … 1606 1608 ac97.pci = ensoniq->pci; 1607 1609 ac97.scaps = AC97_SCAP_AUDIO; 1608 if ((err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97)) < 0) 1610 err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97); 1611 if (err < 0) 1609 1612 return err; 1610 1613 if (has_spdif > 0 || … … 1726 1729 ak4531.private_data = ensoniq; 1727 1730 ak4531.private_free = snd_ensoniq_mixer_free_ak4531; 1728 if ((err = snd_ak4531_mixer(card, &ak4531, &ensoniq->u.es1370.ak4531)) < 0) 1731 err = snd_ak4531_mixer(card, &ak4531, &ensoniq->u.es1370.ak4531); 1732 if (err < 0) 1729 1733 return err; 1730 1734 for (idx = 0; idx < ES1370_CONTROLS; idx++) { … … 2042 2046 2043 2047 *rensoniq = NULL; 2044 if ((err = pci_enable_device(pci)) < 0) 2048 err = pci_enable_device(pci); 2049 if (err < 0) 2045 2050 return err; 2046 2051 ensoniq = kzalloc(sizeof(*ensoniq), GFP_KERNEL); … … 2054 2059 ensoniq->pci = pci; 2055 2060 ensoniq->irq = -1; 2056 if ((err = pci_request_regions(pci, "Ensoniq AudioPCI")) < 0) { 2061 err = pci_request_regions(pci, "Ensoniq AudioPCI"); 2062 if (err < 0) { 2057 2063 kfree(ensoniq); 2058 2064 pci_disable_device(pci); … … 2103 2109 snd_ensoniq_chip_init(ensoniq); 2104 2110 2105 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ensoniq, &ops)) < 0) { 2111 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ensoniq, &ops); 2112 if (err < 0) { 2106 2113 snd_ensoniq_free(ensoniq); 2107 2114 return err; … … 2294 2301 int err; 2295 2302 2296 if ((err = snd_rawmidi_new(ensoniq->card, "ES1370/1", device, 1, 1, &rmidi)) < 0) 2303 err = snd_rawmidi_new(ensoniq->card, "ES1370/1", device, 1, 1, &rmidi); 2304 if (err < 0) 2297 2305 return err; 2298 2306 strcpy(rmidi->name, CHIP_NAME); … … 2365 2373 return err; 2366 2374 2367 if ((err = snd_ensoniq_create(card, pci, &ensoniq)) < 0) { 2375 err = snd_ensoniq_create(card, pci, &ensoniq); 2376 if (err < 0) { 2368 2377 snd_card_free(card); 2369 2378 return err; … … 2372 2381 2373 2382 #ifdef CHIP1370 2374 if ((err = snd_ensoniq_1370_mixer(ensoniq)) < 0) { 2383 err = snd_ensoniq_1370_mixer(ensoniq); 2384 if (err < 0) { 2375 2385 snd_card_free(card); 2376 2386 return err; … … 2378 2388 #endif 2379 2389 #ifdef CHIP1371 2380 if ((err = snd_ensoniq_1371_mixer(ensoniq, spdif[dev], lineio[dev])) < 0) { 2390 err = snd_ensoniq_1371_mixer(ensoniq, spdif[dev], lineio[dev]); 2391 if (err < 0) { 2381 2392 snd_card_free(card); 2382 2393 return err; 2383 2394 } 2384 2395 #endif 2385 if ((err = snd_ensoniq_pcm(ensoniq, 0)) < 0) { 2396 err = snd_ensoniq_pcm(ensoniq, 0); 2397 if (err < 0) { 2386 2398 snd_card_free(card); 2387 2399 return err; 2388 2400 } 2389 if ((err = snd_ensoniq_pcm2(ensoniq, 1)) < 0) { 2401 err = snd_ensoniq_pcm2(ensoniq, 1); 2402 if (err < 0) { 2390 2403 snd_card_free(card); 2391 2404 return err; 2392 2405 } 2393 if ((err = snd_ensoniq_midi(ensoniq, 0)) < 0) { 2406 err = snd_ensoniq_midi(ensoniq, 0); 2407 if (err < 0) { 2394 2408 snd_card_free(card); 2395 2409 return err; … … 2407 2421 ensoniq->irq); 2408 2422 2409 if ((err = snd_card_register(card)) < 0) { 2423 err = snd_card_register(card); 2424 if (err < 0) { 2410 2425 snd_card_free(card); 2411 2426 return err; -
GPL/trunk/alsa-kernel/pci/es1938.c
r695 r703 297 297 unsigned char v; 298 298 for (i = 0; i < WRITE_LOOP_TIMEOUT; i++) { 299 if (!(v = inb(SLSB_REG(chip, READSTATUS)) & 0x80)) { 299 v = inb(SLSB_REG(chip, READSTATUS)); 300 if (!(v & 0x80)) { 300 301 outb(cmd, SLSB_REG(chip, WRITEDATA)); 301 302 return; … … 313 314 int i; 314 315 unsigned char v; 315 for (i = GET_LOOP_TIMEOUT; i; i--) 316 if ((v = inb(SLSB_REG(chip, STATUS))) & 0x80) 316 for (i = GET_LOOP_TIMEOUT; i; i--) { 317 v = inb(SLSB_REG(chip, STATUS)); 318 if (v & 0x80) 317 319 return inb(SLSB_REG(chip, READDATA)); 320 } 318 321 dev_err(chip->card->dev, "get_byte timeout: status 0x02%x\n", v); 319 322 return -ENODEV; … … 997 1000 int err; 998 1001 999 if ((err = snd_pcm_new(chip->card, "es-1938-1946", device, 2, 1, &pcm)) < 0) 1002 err = snd_pcm_new(chip->card, "es-1938-1946", device, 2, 1, &pcm); 1003 if (err < 0) 1000 1004 return err; 1001 1005 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_es1938_playback_ops); … … 1589 1593 1590 1594 /* enable PCI device */ 1591 if ((err = pci_enable_device(pci)) < 0) 1595 err = pci_enable_device(pci); 1596 if (err < 0) 1592 1597 return err; 1593 1598 /* check, if we can restrict PCI DMA transfers to 24 bits */ … … 1609 1614 chip->pci = pci; 1610 1615 chip->irq = -1; 1611 if ((err = pci_request_regions(pci, "ESS Solo-1")) < 0) { 1616 err = pci_request_regions(pci, "ESS Solo-1"); 1617 if (err < 0) { 1612 1618 kfree(chip); 1613 1619 pci_disable_device(pci); … … 1635 1641 snd_es1938_chip_init(chip); 1636 1642 1637 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 1643 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 1644 if (err < 0) { 1638 1645 snd_es1938_free(chip); 1639 1646 return err; … … 1767 1774 break; 1768 1775 } 1769 if ((err = snd_ctl_add(card, kctl)) < 0) 1776 err = snd_ctl_add(card, kctl); 1777 if (err < 0) 1770 1778 return err; 1771 1779 } … … 1801 1809 } 1802 1810 } 1803 if ((err = snd_es1938_create(card, pci, &chip)) < 0) { 1811 err = snd_es1938_create(card, pci, &chip); 1812 if (err < 0) { 1804 1813 snd_card_free(card); 1805 1814 return err; … … 1814 1823 chip->irq); 1815 1824 1816 if ((err = snd_es1938_new_pcm(chip, 0)) < 0) { 1825 err = snd_es1938_new_pcm(chip, 0); 1826 if (err < 0) { 1817 1827 snd_card_free(card); 1818 1828 return err; 1819 1829 } 1820 if ((err = snd_es1938_mixer(chip)) < 0) { 1830 err = snd_es1938_mixer(chip); 1831 if (err < 0) { 1821 1832 snd_card_free(card); 1822 1833 return err; … … 1829 1840 SLSB_REG(chip, FMLOWADDR)); 1830 1841 } else { 1831 if ((err = snd_opl3_timer_new(opl3, 0, 1)) < 0) { 1842 err = snd_opl3_timer_new(opl3, 0, 1); 1843 if (err < 0) { 1832 1844 snd_card_free(card); 1833 1845 return err; 1834 1846 } 1835 if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 1847 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 1848 if (err < 0) { 1836 1849 snd_card_free(card); 1837 1850 return err; … … 1851 1864 snd_es1938_create_gameport(chip); 1852 1865 1853 if ((err = snd_card_register(card)) < 0) { 1866 err = snd_card_register(card); 1867 if (err < 0) { 1854 1868 snd_card_free(card); 1855 1869 return err; -
GPL/trunk/alsa-kernel/pci/es1968.c
r695 r703 1616 1616 1617 1617 /* get mixbuffer */ 1618 if ((es->mixbuf = snd_es1968_new_memory(chip, ESM_MIXBUF_SIZE)) == NULL) { 1618 es->mixbuf = snd_es1968_new_memory(chip, ESM_MIXBUF_SIZE); 1619 if (!es->mixbuf) { 1619 1620 snd_es1968_free_apu_pair(chip, apu1); 1620 1621 snd_es1968_free_apu_pair(chip, apu2); … … 1715 1716 1716 1717 /* search 2 APUs (although one apu is enough) */ 1717 if ((apu = snd_es1968_alloc_apu_pair(chip, ESM_APU_PCM_PLAY)) < 0) { 1718 apu = snd_es1968_alloc_apu_pair(chip, ESM_APU_PCM_PLAY); 1719 if (apu < 0) { 1718 1720 dev_err(chip->card->dev, "Hmm, cannot find empty APU pair!?\n"); 1719 1721 return; 1720 1722 } 1721 if ((memory = snd_es1968_new_memory(chip, CLOCK_MEASURE_BUFSIZE)) == NULL) { 1723 memory = snd_es1968_new_memory(chip, CLOCK_MEASURE_BUFSIZE); 1724 if (!memory) { 1722 1725 dev_warn(chip->card->dev, 1723 1726 "cannot allocate dma buffer - using default clock %d\n", … … 1828 1831 1829 1832 /* get DMA buffer */ 1830 if ((err = snd_es1968_init_dmabuf(chip)) < 0) 1833 err = snd_es1968_init_dmabuf(chip); 1834 if (err < 0) 1831 1835 return err; 1832 1836 … … 1837 1841 wave_set_register(chip, 0x01FF, chip->dma.addr >> 12); 1838 1842 1839 if ((err = snd_pcm_new(chip->card, "ESS Maestro", device, 1840 chip->playback_streams, 1841 chip->capture_streams, &pcm)) < 0) 1843 err = snd_pcm_new(chip->card, "ESS Maestro", device, 1844 chip->playback_streams, 1845 chip->capture_streams, &pcm); 1846 if (err < 0) 1842 1847 return err; 1843 1848 … … 1990 1995 u32 event; 1991 1996 1992 if (!(event = inb(chip->io_port + 0x1A))) 1997 event = inb(chip->io_port + 0x1A); 1998 if (!event) 1993 1999 return IRQ_NONE; 1994 2000 … … 2045 2051 }; 2046 2052 2047 if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0) 2053 err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus); 2054 if (err < 0) 2048 2055 return err; 2049 2056 pbus->no_vra = 1; /* ES1968 doesn't need VRA */ … … 2051 2058 memset(&ac97, 0, sizeof(ac97)); 2052 2059 ac97.private_data = chip; 2053 if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97)) < 0) 2060 err = snd_ac97_mixer(pbus, &ac97, &chip->ac97); 2061 if (err < 0) 2054 2062 return err; 2055 2063 … … 2698 2706 2699 2707 /* enable PCI device */ 2700 if ((err = pci_enable_device(pci)) < 0) 2708 err = pci_enable_device(pci); 2709 if (err < 0) 2701 2710 return err; 2702 2711 /* check, if we can restrict PCI DMA transfers to 28 bits */ … … 2729 2738 chip->capture_streams = capt_streams; 2730 2739 2731 if ((err = pci_request_regions(pci, "ESS Maestro")) < 0) { 2740 err = pci_request_regions(pci, "ESS Maestro"); 2741 if (err < 0) { 2732 2742 kfree(chip); 2733 2743 pci_disable_device(pci); … … 2776 2786 snd_es1968_chip_init(chip); 2777 2787 2778 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 2788 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 2789 if (err < 0) { 2779 2790 snd_es1968_free(chip); 2780 2791 return err; … … 2841 2852 if (total_bufsize[dev] > 4096) 2842 2853 total_bufsize[dev] = 4096; 2843 if ((err = snd_es1968_create(card, pci, 2844 total_bufsize[dev] * 1024, /* in bytes */ 2845 pcm_substreams_p[dev], 2846 pcm_substreams_c[dev], 2847 pci_id->driver_data, 2848 use_pm[dev], 2849 radio_nr[dev], 2850 &chip)) < 0) { 2854 err = snd_es1968_create(card, pci, 2855 total_bufsize[dev] * 1024, /* in bytes */ 2856 pcm_substreams_p[dev], 2857 pcm_substreams_c[dev], 2858 pci_id->driver_data, 2859 use_pm[dev], 2860 radio_nr[dev], 2861 &chip); 2862 if (err < 0) { 2851 2863 snd_card_free(card); 2852 2864 return err; … … 2869 2881 } 2870 2882 2871 if ((err = snd_es1968_pcm(chip, 0)) < 0) { 2883 err = snd_es1968_pcm(chip, 0); 2884 if (err < 0) { 2872 2885 snd_card_free(card); 2873 2886 return err; 2874 2887 } 2875 2888 2876 if ((err = snd_es1968_mixer(chip)) < 0) { 2889 err = snd_es1968_mixer(chip); 2890 if (err < 0) { 2877 2891 snd_card_free(card); 2878 2892 return err; … … 2892 2906 } 2893 2907 if (enable_mpu[dev]) { 2894 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, 2895 chip->io_port + ESM_MPU401_PORT, 2896 MPU401_INFO_INTEGRATED | 2897 MPU401_INFO_IRQ_HOOK, 2898 -1, &chip->rmidi)) < 0) { 2908 err = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, 2909 chip->io_port + ESM_MPU401_PORT, 2910 MPU401_INFO_INTEGRATED | 2911 MPU401_INFO_IRQ_HOOK, 2912 -1, &chip->rmidi); 2913 if (err < 0) 2899 2914 dev_warn(card->dev, "skipping MPU-401 MIDI support..\n"); 2900 }2901 2915 } 2902 2916 … … 2919 2933 card->shortname, chip->io_port, chip->irq); 2920 2934 2921 if ((err = snd_card_register(card)) < 0) { 2935 err = snd_card_register(card); 2936 if (err < 0) { 2922 2937 snd_card_free(card); 2923 2938 return err; -
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; -
GPL/trunk/alsa-kernel/pci/hda/hda_bind.c
r689 r703 170 170 struct hda_codec *codec = dev_to_hda_codec(dev); 171 171 172 if (!pm_runtime_suspended(dev) && codec->patch_ops.reboot_notify) 173 codec->patch_ops.reboot_notify(codec); 172 if (!pm_runtime_suspended(dev)) { 173 if (codec->patch_ops.reboot_notify) 174 codec->patch_ops.reboot_notify(codec); 175 snd_hda_codec_display_power(codec, false); 176 } 174 177 } 175 178 -
GPL/trunk/alsa-kernel/pci/hda/hda_codec.c
r695 r703 809 809 810 810 /* enable/disable display power per codec */ 811 static voidcodec_display_power(struct hda_codec *codec, bool enable)811 void snd_hda_codec_display_power(struct hda_codec *codec, bool enable) 812 812 { 813 813 if (codec->display_power_control) … … 821 821 return; 822 822 if (device_is_registered(hda_codec_dev(codec))) { 823 codec_display_power(codec, true);823 snd_hda_codec_display_power(codec, true); 824 824 pm_runtime_enable(hda_codec_dev(codec)); 825 825 /* it was powered up in snd_hda_codec_new(), now all done */ … … 847 847 if (codec->core.type == HDA_DEV_LEGACY) 848 848 snd_hdac_device_unregister(&codec->core); 849 codec_display_power(codec, false);849 snd_hda_codec_display_power(codec, false); 850 850 851 851 /* … … 2909 2909 (state & AC_PWRST_CLK_STOP_OK))) 2910 2910 snd_hdac_codec_link_down(&codec->core); 2911 codec_display_power(codec, false);2911 snd_hda_codec_display_power(codec, false); 2912 2912 return 0; 2913 2913 } … … 2921 2921 return 0; 2922 2922 2923 codec_display_power(codec, true);2923 snd_hda_codec_display_power(codec, true); 2924 2924 snd_hdac_codec_link_up(&codec->core); 2925 2925 hda_call_codec_resume(codec); -
GPL/trunk/alsa-kernel/pci/hda/hda_generic.c
r695 r703 1437 1437 } 1438 1438 if (!path) { 1439 dac = dacs[i] = 0;1439 dacs[i] = 0; 1440 1440 badness += bad->no_dac; 1441 1441 } else { … … 3472 3472 const struct hda_input_mux *imux; 3473 3473 struct nid_path *path; 3474 int i, adc_idx, err = 0;3474 int i, adc_idx, ret, err = 0; 3475 3475 3476 3476 imux = &spec->input_mux; … … 3482 3482 continue; 3483 3483 kcontrol->private_value = path->ctls[type]; 3484 err = func(kcontrol, ucontrol); 3485 if (err < 0) 3484 ret = func(kcontrol, ucontrol); 3485 if (ret < 0) { 3486 err = ret; 3486 3487 break; 3488 } 3489 if (ret > 0) 3490 err = 1; 3487 3491 } 3488 3492 mutex_unlock(&codec->control_mutex); -
GPL/trunk/alsa-kernel/pci/hda/hda_intel.c
r695 r703 909 909 } 910 910 911 static void __azx_shutdown_chip(struct azx *chip, bool skip_link_reset) 912 { 913 azx_stop_chip(chip); 914 if (!skip_link_reset) 915 azx_enter_link_reset(chip); 916 azx_clear_irq_pending(chip); 917 display_power(chip, false); 918 } 919 911 920 #ifdef CONFIG_PM 912 921 static DEFINE_MUTEX(card_list_lock); 913 922 static LIST_HEAD(card_list); 923 924 static void azx_shutdown_chip(struct azx *chip) 925 { 926 __azx_shutdown_chip(chip, false); 927 } 914 928 915 929 static void azx_add_card_list(struct azx *chip) … … 970 984 } 971 985 972 static void __azx_runtime_suspend(struct azx *chip)973 {974 azx_stop_chip(chip);975 azx_enter_link_reset(chip);976 azx_clear_irq_pending(chip);977 display_power(chip, false);978 }979 980 986 static void __azx_runtime_resume(struct azx *chip) 981 987 { … … 1056 1062 chip = card->private_data; 1057 1063 bus = azx_bus(chip); 1058 __azx_runtime_suspend(chip);1064 azx_shutdown_chip(chip); 1059 1065 if (bus->irq >= 0) { 1060 1066 free_irq(bus->irq, chip); … … 1136 1142 azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) | STATESTS_INT_MASK); 1137 1143 1138 __azx_runtime_suspend(chip);1144 azx_shutdown_chip(chip); 1139 1145 trace_azx_runtime_suspend(chip); 1140 1146 return 0; … … 2435 2441 chip = card->private_data; 2436 2442 if (chip && chip->running) 2437 azx_stop_chip(chip);2443 __azx_shutdown_chip(chip, true); 2438 2444 } 2439 2445 -
GPL/trunk/alsa-kernel/pci/hda/hda_local.h
r695 r703 724 724 void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen); 725 725 726 void snd_hda_codec_display_power(struct hda_codec *codec, bool enable); 727 726 728 /* 727 729 */ -
GPL/trunk/alsa-kernel/pci/hda/hda_tegra.c
r695 r703 236 236 struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip); 237 237 struct hdac_bus *bus = azx_bus(chip); 238 struct device *dev = hda->dev;239 238 struct resource *res; 240 239 241 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 242 hda->regs = devm_ioremap_resource(dev, res); 240 hda->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res); 243 241 if (IS_ERR(hda->regs)) 244 242 return PTR_ERR(hda->regs); -
GPL/trunk/alsa-kernel/pci/hda/patch_ca0132.c
r695 r703 7697 7697 static void ca0132_alt_start_dsp_audio_streams(struct hda_codec *codec) 7698 7698 { 7699 const unsigned int dsp_dma_stream_ids[] = { 0x0c, 0x03, 0x04 };7699 static const unsigned int dsp_dma_stream_ids[] = { 0x0c, 0x03, 0x04 }; 7700 7700 struct ca0132_spec *spec = codec->spec; 7701 7701 unsigned int i, tmp; -
GPL/trunk/alsa-kernel/pci/hda/patch_hdmi.c
r695 r703 1949 1949 SND_PCI_QUIRK(0x103c, 0x871a, "HP", 1), 1950 1950 SND_PCI_QUIRK(0x1462, 0xec94, "MS-7C94", 1), 1951 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", 1), 1951 1952 {} 1952 1953 }; -
GPL/trunk/alsa-kernel/pci/hda/patch_realtek.c
r695 r703 3697 3697 ALC269_TYPE_ALC215, 3698 3698 ALC269_TYPE_ALC225, 3699 ALC269_TYPE_ALC287, 3699 3700 ALC269_TYPE_ALC294, 3700 3701 ALC269_TYPE_ALC300, … … 3733 3734 case ALC269_TYPE_ALC215: 3734 3735 case ALC269_TYPE_ALC225: 3736 case ALC269_TYPE_ALC287: 3735 3737 case ALC269_TYPE_ALC294: 3736 3738 case ALC269_TYPE_ALC300: … … 4205 4207 } 4206 4208 4209 static void alc285_hp_init(struct hda_codec *codec) 4210 { 4211 struct alc_spec *spec = codec->spec; 4212 hda_nid_t hp_pin = alc_get_hp_pin(spec); 4213 int i, val; 4214 int coef38, coef0d, coef36; 4215 4216 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */ 4217 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */ 4218 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */ 4219 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */ 4220 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0); 4221 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0); 4222 4223 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); 4224 4225 if (hp_pin) 4226 snd_hda_codec_write(codec, hp_pin, 0, 4227 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 4228 4229 msleep(130); 4230 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14); 4231 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0); 4232 4233 if (hp_pin) 4234 snd_hda_codec_write(codec, hp_pin, 0, 4235 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 4236 msleep(10); 4237 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */ 4238 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880); 4239 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049); 4240 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0); 4241 4242 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */ 4243 val = alc_read_coefex_idx(codec, 0x58, 0x00); 4244 for (i = 0; i < 20 && val & 0x8000; i++) { 4245 msleep(50); 4246 val = alc_read_coefex_idx(codec, 0x58, 0x00); 4247 } /* Wait for depop procedure finish */ 4248 4249 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */ 4250 alc_update_coef_idx(codec, 0x38, 1<<4, coef38); 4251 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d); 4252 alc_update_coef_idx(codec, 0x36, 3<<13, coef36); 4253 4254 msleep(50); 4255 alc_update_coef_idx(codec, 0x4a, 1<<15, 0); 4256 } 4257 4207 4258 static void alc225_init(struct hda_codec *codec) 4208 4259 { … … 4210 4261 hda_nid_t hp_pin = alc_get_hp_pin(spec); 4211 4262 bool hp1_pin_sense, hp2_pin_sense; 4263 4264 if (spec->codec_variant != ALC269_TYPE_ALC287) 4265 /* required only at boot or S3 and S4 resume time */ 4266 #ifndef TARGET_OS2 4267 if (!spec->done_hp_init || 4268 is_s3_resume(codec) || 4269 is_s4_resume(codec)) { 4270 #else 4271 if (!spec->done_hp_init ) { 4272 4273 #endif 4274 alc285_hp_init(codec); 4275 spec->done_hp_init = true; 4276 } 4212 4277 4213 4278 if (!hp_pin) … … 7289 7354 ALC623_FIXUP_LENOVO_THINKSTATION_P340, 7290 7355 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, 7356 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST, 7291 7357 }; 7292 7358 … … 9184 9250 }, 9185 9251 #endif 9252 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = { 9253 .type = HDA_FIXUP_FUNC, 9254 .v.func = alc269_fixup_limit_int_mic_boost, 9255 .chained = true, 9256 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, 9257 }, 9186 9258 }; 9187 9259 … … 9274 9346 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), 9275 9347 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC), 9348 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK), 9276 9349 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 9277 9350 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), … … 9372 9445 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED), 9373 9446 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), 9447 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), 9374 9448 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), 9449 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 9375 9450 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 9376 9451 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), … … 9378 9453 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 9379 9454 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 9380 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_ MUTE_LED_MICMUTE_VREF),9381 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_ MUTE_LED_MICMUTE_VREF),9455 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST), 9456 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST), 9382 9457 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 9383 9458 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), … … 9407 9482 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS), 9408 9483 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), 9484 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK), 9409 9485 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), 9410 9486 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), … … 9463 9539 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK), 9464 9540 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9465 SND_PCI_QUIRK(0x1558, 0x1325, " System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),9541 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9466 9542 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9467 9543 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), … … 9498 9574 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9499 9575 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9500 SND_PCI_QUIRK(0x1558, 0x8550, " System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),9501 SND_PCI_QUIRK(0x1558, 0x8551, " System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),9502 SND_PCI_QUIRK(0x1558, 0x8560, " System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),9503 SND_PCI_QUIRK(0x1558, 0x8561, " System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),9504 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[5 |7][0-9]RZ[Q]", ALC269_FIXUP_DMIC),9576 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9577 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9578 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC), 9579 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC), 9580 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC), 9505 9581 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9506 9582 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), … … 9513 9589 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9514 9590 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9515 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5 3RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),9516 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL5 XNU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),9591 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9592 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9517 9593 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9518 9594 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), … … 10401 10477 case 0x10ec0245: 10402 10478 case 0x10ec0285: 10403 case 0x10ec0287:10404 10479 case 0x10ec0289: 10405 10480 spec->codec_variant = ALC269_TYPE_ALC215; … … 10415 10490 spec->init_hook = alc225_init; 10416 10491 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ 10492 break; 10493 case 0x10ec0287: 10494 spec->codec_variant = ALC269_TYPE_ALC287; 10495 spec->shutup = alc225_shutup; 10496 spec->init_hook = alc225_init; 10497 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */ 10417 10498 break; 10418 10499 case 0x10ec0234: … … 10452 10533 snd_hda_pick_fixup(codec, alc269_fixup_models, 10453 10534 alc269_fixup_tbl, alc269_fixups); 10535 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and 10536 * the quirk breaks the latter (bko#214101). 10537 * Clear the wrong entry. 10538 */ 10539 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 && 10540 codec->core.vendor_id == 0x10ec0294) { 10541 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n"); 10542 codec->fixup_id = HDA_FIXUP_ID_NOT_SET; 10543 } 10544 10454 10545 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true); 10455 10546 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false); -
GPL/trunk/alsa-kernel/pci/hda/patch_via.c
r679 r703 1063 1063 1064 1064 static const struct snd_pci_quirk vt2002p_fixups[] = { 1065 SND_PCI_QUIRK(0x1043, 0x13f7, "Asus B23E", VIA_FIXUP_POWER_SAVE), 1065 1066 SND_PCI_QUIRK(0x1043, 0x1487, "Asus G75", VIA_FIXUP_ASUS_G75), 1066 1067 SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST), -
GPL/trunk/alsa-kernel/pci/intel8x0.c
r695 r703 83 83 ICH_REG_##name##_PIV = base + 0x0a, /* byte - prefetched index value */ \ 84 84 ICH_REG_##name##_CR = base + 0x0b, /* byte - control register */ \ 85 } ;85 } 86 86 87 87 /* busmaster blocks */ … … 542 542 } else { 543 543 res = iagetword(chip, reg + ac97->num * 0x80); 544 if ((tmp = igetdword(chip, ICHREG(GLOB_STA))) & ICH_RCS) { 544 tmp = igetdword(chip, ICHREG(GLOB_STA)); 545 if (tmp & ICH_RCS) { 545 546 /* reset RCS and preserve other R/WC bits */ 546 547 iputdword(chip, ICHREG(GLOB_STA), tmp & … … 563 564 if (snd_intel8x0_codec_semaphore(chip, codec) >= 0) { 564 565 iagetword(chip, codec * 0x80); 565 if ((tmp = igetdword(chip, ICHREG(GLOB_STA))) & ICH_RCS) { 566 tmp = igetdword(chip, ICHREG(GLOB_STA)); 567 if (tmp & ICH_RCS) { 566 568 /* reset RCS and preserve other R/WC bits */ 567 569 iputdword(chip, ICHREG(GLOB_STA), tmp & … … 1109 1111 runtime->hw.period_bytes_max = 64*1024; 1110 1112 } 1111 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 1113 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 1114 if (err < 0) 1112 1115 return err; 1113 1116 runtime->private_data = ichdev; … … 2194 2197 } 2195 2198 } 2196 if ((err = snd_ac97_bus(chip->card, 0, ops, chip, &pbus)) < 0) 2199 err = snd_ac97_bus(chip->card, 0, ops, chip, &pbus); 2200 if (err < 0) 2197 2201 goto __err; 2198 2202 pbus->private_free = snd_intel8x0_mixer_free_ac97_bus; … … 2210 2214 for (i = 0; i < codecs; i++) { 2211 2215 ac97.num = i; 2212 if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) { 2216 err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i]); 2217 if (err < 0) { 2213 2218 if (err != -EACCES) 2214 2219 dev_err(chip->card->dev, … … 2497 2502 2498 2503 if (chip->device_type != DEVICE_ALI) { 2499 if ((err = snd_intel8x0_ich_chip_init(chip, probing)) < 0) 2504 err = snd_intel8x0_ich_chip_init(chip, probing); 2505 if (err < 0) 2500 2506 return err; 2501 2507 iagetword(chip, 0); /* clear semaphore flag */ 2502 2508 } else { 2503 if ((err = snd_intel8x0_ali_chip_init(chip, probing)) < 0) 2509 err = snd_intel8x0_ali_chip_init(chip, probing); 2510 if (err < 0) 2504 2511 return err; 2505 2512 } … … 2943 2950 *r_intel8x0 = NULL; 2944 2951 2945 if ((err = pci_enable_device(pci)) < 0) 2952 err = pci_enable_device(pci); 2953 if (err < 0) 2946 2954 return err; 2947 2955 … … 2975 2983 chip->fix_nocache = 1; /* enable workaround */ 2976 2984 2977 if ((err = pci_request_regions(pci, card->shortname)) < 0) { 2985 err = pci_request_regions(pci, card->shortname); 2986 if (err < 0) { 2978 2987 kfree(chip); 2979 2988 pci_disable_device(pci); … … 3089 3098 chip->codec_isr_bits |= chip->codec_bit[i]; 3090 3099 3091 if ((err = snd_intel8x0_chip_init(chip, 1)) < 0) { 3100 err = snd_intel8x0_chip_init(chip, 1); 3101 if (err < 0) { 3092 3102 snd_intel8x0_free(chip); 3093 3103 return err; … … 3104 3114 card->sync_irq = chip->irq; 3105 3115 3106 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 3116 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 3117 if (err < 0) { 3107 3118 snd_intel8x0_free(chip); 3108 3119 return err; … … 3211 3222 } 3212 3223 3213 if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data,3214 &chip))< 0) {3224 err = snd_intel8x0_create(card, pci, pci_id->driver_data, &chip); 3225 if (err < 0) { 3215 3226 snd_card_free(card); 3216 3227 return err; … … 3218 3229 card->private_data = chip; 3219 3230 3220 if ((err = snd_intel8x0_mixer(chip, ac97_clock, ac97_quirk)) < 0) { 3231 err = snd_intel8x0_mixer(chip, ac97_clock, ac97_quirk); 3232 if (err < 0) { 3221 3233 snd_card_free(card); 3222 3234 return err; 3223 3235 } 3224 if ((err = snd_intel8x0_pcm(chip)) < 0) { 3236 err = snd_intel8x0_pcm(chip); 3237 if (err < 0) { 3225 3238 snd_card_free(card); 3226 3239 return err; … … 3242 3255 } 3243 3256 3244 if ((err = snd_card_register(card)) < 0) { 3257 err = snd_card_register(card); 3258 if (err < 0) { 3245 3259 snd_card_free(card); 3246 3260 return err; -
GPL/trunk/alsa-kernel/pci/intel8x0m.c
r695 r703 58 58 ICH_REG_##name##_PIV = base + 0x0a, /* byte - prefetched index value */ \ 59 59 ICH_REG_##name##_CR = base + 0x0b, /* byte - control register */ \ 60 } ;60 } 61 61 62 62 /* busmaster blocks */ … … 343 343 } else { 344 344 res = iagetword(chip, reg + ac97->num * 0x80); 345 if ((tmp = igetdword(chip, ICHREG(GLOB_STA))) & ICH_RCS) { 345 tmp = igetdword(chip, ICHREG(GLOB_STA)); 346 if (tmp & ICH_RCS) { 346 347 /* reset RCS and preserve other R/WC bits */ 347 348 iputdword(chip, ICHREG(GLOB_STA), … … 801 802 glob_sta = igetdword(chip, ICHREG(GLOB_STA)); 802 803 803 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus)) < 0) 804 err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus); 805 if (err < 0) 804 806 goto __err; 805 807 pbus->private_free = snd_intel8x0m_mixer_free_ac97_bus; … … 810 812 ac97.pci = chip->pci; 811 813 ac97.num = glob_sta & ICH_SCR ? 1 : 0; 812 if ((err = snd_ac97_mixer(pbus, &ac97, &x97)) < 0) { 814 err = snd_ac97_mixer(pbus, &ac97, &x97); 815 if (err < 0) { 813 816 dev_err(chip->card->dev, 814 817 "Unable to initialize codec #%d\n", ac97.num); … … 928 931 int err; 929 932 930 if ((err = snd_intel8x0m_ich_chip_init(chip, probing)) < 0) 933 err = snd_intel8x0m_ich_chip_init(chip, probing); 934 if (err < 0) 931 935 return err; 932 936 iagetword(chip, 0); /* clear semaphore flag */ … … 1076 1080 *r_intel8x0m = NULL; 1077 1081 1078 if ((err = pci_enable_device(pci)) < 0) 1082 err = pci_enable_device(pci); 1083 if (err < 0) 1079 1084 return err; 1080 1085 … … 1090 1095 chip->irq = -1; 1091 1096 1092 if ((err = pci_request_regions(pci, card->shortname)) < 0) { 1097 err = pci_request_regions(pci, card->shortname); 1098 if (err < 0) { 1093 1099 kfree(chip); 1094 1100 pci_disable_device(pci); … … 1168 1174 pci_set_master(pci); 1169 1175 1170 if ((err = snd_intel8x0m_chip_init(chip, 1)) < 0) { 1176 err = snd_intel8x0m_chip_init(chip, 1); 1177 if (err < 0) { 1171 1178 snd_intel8x0m_free(chip); 1172 1179 return err; … … 1182 1189 card->sync_irq = chip->irq; 1183 1190 1184 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 1191 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 1192 if (err < 0) { 1185 1193 snd_intel8x0m_free(chip); 1186 1194 return err; … … 1239 1247 strcat(card->shortname," Modem"); 1240 1248 1241 if ((err = snd_intel8x0m_create(card, pci, pci_id->driver_data, &chip)) < 0) { 1249 err = snd_intel8x0m_create(card, pci, pci_id->driver_data, &chip); 1250 if (err < 0) { 1242 1251 snd_card_free(card); 1243 1252 return err; … … 1245 1254 card->private_data = chip; 1246 1255 1247 if ((err = snd_intel8x0m_mixer(chip, ac97_clock)) < 0) { 1256 err = snd_intel8x0m_mixer(chip, ac97_clock); 1257 if (err < 0) { 1248 1258 snd_card_free(card); 1249 1259 return err; 1250 1260 } 1251 if ((err = snd_intel8x0m_pcm(chip)) < 0) { 1261 err = snd_intel8x0m_pcm(chip); 1262 if (err < 0) { 1252 1263 snd_card_free(card); 1253 1264 return err; … … 1259 1270 card->shortname, chip->irq); 1260 1271 1261 if ((err = snd_card_register(card)) < 0) { 1272 err = snd_card_register(card); 1273 if (err < 0) { 1262 1274 snd_card_free(card); 1263 1275 return err; -
GPL/trunk/alsa-kernel/pci/korg1212/korg1212.c
r695 r703 1528 1528 } 1529 1529 1530 if ((err = snd_korg1212_SetRate(korg1212, params_rate(params))) < 0) { 1530 err = snd_korg1212_SetRate(korg1212, params_rate(params)); 1531 if (err < 0) { 1531 1532 spin_unlock_irqrestore(&korg1212->lock, flags); 1532 1533 return err; … … 2160 2161 2161 2162 * rchip = NULL; 2162 if ((err = pci_enable_device(pci)) < 0) 2163 err = pci_enable_device(pci); 2164 if (err < 0) 2163 2165 return err; 2164 2166 … … 2197 2199 korg1212->volumePhase[i] = 0; 2198 2200 2199 if ((err = pci_request_regions(pci, "korg1212")) < 0) { 2201 err = pci_request_regions(pci, "korg1212"); 2202 if (err < 0) { 2200 2203 kfree(korg1212); 2201 2204 pci_disable_device(pci); … … 2221 2224 stateName[korg1212->cardState]); 2222 2225 2223 if ((korg1212->iobase = ioremap(korg1212->iomem, iomem_size)) == NULL) { 2226 korg1212->iobase = ioremap(korg1212->iomem, iomem_size); 2227 if (!korg1212->iobase) { 2224 2228 snd_printk(KERN_ERR "korg1212: unable to remap memory region 0x%lx-0x%lx\n", korg1212->iomem, 2225 2229 korg1212->iomem + iomem_size - 1); … … 2361 2365 K1212_DEBUG_PRINTK("K1212_DEBUG: Reboot Card - RC = %d [%s]\n", rc, stateName[korg1212->cardState]); 2362 2366 2363 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, korg1212, &ops)) < 0) { 2367 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, korg1212, &ops); 2368 if (err < 0) { 2364 2369 snd_korg1212_free(korg1212); 2365 2370 return err; … … 2386 2391 korg1212->AdatTimeCodePhy, LowerWordSwap(korg1212->AdatTimeCodePhy)); 2387 2392 2388 if ((err = snd_pcm_new(korg1212->card, "korg1212", 0, 1, 1, &korg1212->pcm)) < 0) 2393 err = snd_pcm_new(korg1212->card, "korg1212", 0, 1, 1, &korg1212->pcm); 2394 if (err < 0) 2389 2395 return err; 2390 2396 … … 2437 2443 return err; 2438 2444 2439 if ((err = snd_korg1212_create(card, pci, &korg1212)) < 0) { 2445 err = snd_korg1212_create(card, pci, &korg1212); 2446 if (err < 0) { 2440 2447 snd_card_free(card); 2441 2448 return err; … … 2449 2456 K1212_DEBUG_PRINTK("K1212_DEBUG: %s\n", card->longname); 2450 2457 2451 if ((err = snd_card_register(card)) < 0) { 2458 err = snd_card_register(card); 2459 if (err < 0) { 2452 2460 snd_card_free(card); 2453 2461 return err; -
GPL/trunk/alsa-kernel/pci/maestro3.c
r695 r703 1777 1777 int err; 1778 1778 1779 if ((err = snd_m3_substream_open(chip, subs)) < 0) 1779 err = snd_m3_substream_open(chip, subs); 1780 if (err < 0) 1780 1781 return err; 1781 1782 … … 1801 1802 int err; 1802 1803 1803 if ((err = snd_m3_substream_open(chip, subs)) < 0) 1804 err = snd_m3_substream_open(chip, subs); 1805 if (err < 0) 1804 1806 return err; 1805 1807 … … 2048 2050 }; 2049 2051 2050 if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0) 2052 err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus); 2053 if (err < 0) 2051 2054 return err; 2052 2055 2053 2056 memset(&ac97, 0, sizeof(ac97)); 2054 2057 ac97.private_data = chip; 2055 if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97)) < 0) 2058 err = snd_ac97_mixer(pbus, &ac97, &chip->ac97); 2059 if (err < 0) 2056 2060 return err; 2057 2061 … … 2654 2658 goto free_chip; 2655 2659 2656 if ((err = snd_m3_mixer(chip)) < 0) 2660 err = snd_m3_mixer(chip); 2661 if (err < 0) 2657 2662 return err; 2658 2663 2659 2664 for (i = 0; i < chip->num_substreams; i++) { 2660 2665 struct m3_dma *s = &chip->substreams[i]; 2661 if ((err = snd_m3_assp_client_init(chip, s, i)) < 0) 2666 err = snd_m3_assp_client_init(chip, s, i); 2667 if (err < 0) 2662 2668 return err; 2663 2669 } 2664 2670 2665 if ((err = snd_m3_pcm(chip, 0)) < 0) 2671 err = snd_m3_pcm(chip, 0); 2672 if (err < 0) 2666 2673 return err; 2667 2674 -
GPL/trunk/alsa-kernel/pci/nm256/nm256.c
r695 r703 1323 1323 return -ENOMEM; 1324 1324 1325 if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0) 1325 err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus); 1326 if (err < 0) 1326 1327 return err; 1327 1328 … … 1481 1482 *chip_ret = NULL; 1482 1483 1483 if ((err = pci_enable_device(pci)) < 0) 1484 err = pci_enable_device(pci); 1485 if (err < 0) 1484 1486 return err; 1485 1487 … … 1573 1575 else { 1574 1576 /* get buffer end pointer from signature */ 1575 if ((err = snd_nm256_peek_for_sig(chip)) < 0) 1577 err = snd_nm256_peek_for_sig(chip); 1578 if (err < 0) 1576 1579 goto __error; 1577 1580 } … … 1623 1626 // pci_set_master(pci); /* needed? */ 1624 1627 1625 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) 1628 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 1629 if (err < 0) 1626 1630 goto __error; 1627 1631 … … 1705 1709 if (capture_bufsize > 128) 1706 1710 capture_bufsize = 128; 1707 if ((err = snd_nm256_create(card, pci, &chip)) < 0) { 1711 err = snd_nm256_create(card, pci, &chip); 1712 if (err < 0) { 1708 1713 snd_card_free(card); 1709 1714 return err; … … 1721 1726 } 1722 1727 1723 if ((err = snd_nm256_pcm(chip, 0)) < 0 || 1724 (err = snd_nm256_mixer(chip)) < 0) { 1728 err = snd_nm256_pcm(chip, 0); 1729 if (err < 0) { 1730 snd_card_free(card); 1731 return err; 1732 } 1733 err = snd_nm256_mixer(chip); 1734 if (err < 0) { 1725 1735 snd_card_free(card); 1726 1736 return err; … … 1732 1742 chip->buffer_addr, chip->cport_addr, chip->irq); 1733 1743 1734 if ((err = snd_card_register(card)) < 0) { 1744 err = snd_card_register(card); 1745 if (err < 0) { 1735 1746 snd_card_free(card); 1736 1747 return err; -
GPL/trunk/alsa-kernel/pci/rme32.c
r695 r703 669 669 670 670 spin_lock_irq(&rme32->lock); 671 if ((rme32->rcreg & RME32_RCR_KMODE) && 672 (rate = snd_rme32_capture_getrate(rme32, &dummy)) > 0) { 671 rate = 0; 672 if (rme32->rcreg & RME32_RCR_KMODE) 673 rate = snd_rme32_capture_getrate(rme32, &dummy); 674 if (rate > 0) { 673 675 /* AutoSync */ 674 676 if ((int)params_rate(params) != rate) { … … 676 678 return -EIO; 677 679 } 678 } else if ((err = snd_rme32_playback_setrate(rme32, params_rate(params))) < 0) { 679 spin_unlock_irq(&rme32->lock); 680 return err; 681 } 682 if ((err = snd_rme32_setformat(rme32, params_format(params))) < 0) { 680 } else { 681 err = snd_rme32_playback_setrate(rme32, params_rate(params)); 682 if (err < 0) { 683 spin_unlock_irq(&rme32->lock); 684 return err; 685 } 686 } 687 err = snd_rme32_setformat(rme32, params_format(params)); 688 if (err < 0) { 683 689 spin_unlock_irq(&rme32->lock); 684 690 return err; … … 724 730 writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER); 725 731 726 if ((err = snd_rme32_setformat(rme32, params_format(params))) < 0) { 732 err = snd_rme32_setformat(rme32, params_format(params)); 733 if (err < 0) { 727 734 spin_unlock_irq(&rme32->lock); 728 735 return err; 729 736 } 730 if ((err = snd_rme32_playback_setrate(rme32, params_rate(params))) < 0) { 737 err = snd_rme32_playback_setrate(rme32, params_rate(params)); 738 if (err < 0) { 731 739 spin_unlock_irq(&rme32->lock); 732 740 return err; 733 741 } 734 if ((rate = snd_rme32_capture_getrate(rme32, &isadat)) > 0) { 742 rate = snd_rme32_capture_getrate(rme32, &isadat); 743 if (rate > 0) { 735 744 if ((int)params_rate(params) != rate) { 736 745 spin_unlock_irq(&rme32->lock); … … 855 864 runtime->hw.rate_max = 96000; 856 865 } 857 if ((rme32->rcreg & RME32_RCR_KMODE) && 858 (rate = snd_rme32_capture_getrate(rme32, &dummy)) > 0) { 866 rate = 0; 867 if (rme32->rcreg & RME32_RCR_KMODE) 868 rate = snd_rme32_capture_getrate(rme32, &dummy); 869 if (rate > 0) { 859 870 /* AutoSync */ 860 871 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); … … 896 907 runtime->hw.rate_max = 96000; 897 908 } 898 if ((rate = snd_rme32_capture_getrate(rme32, &isadat)) > 0) { 909 rate = snd_rme32_capture_getrate(rme32, &isadat); 910 if (rate > 0) { 899 911 if (isadat) { 900 912 return -EIO; … … 933 945 else 934 946 runtime->hw = snd_rme32_adat_info; 935 if ((rme32->rcreg & RME32_RCR_KMODE) && 936 (rate = snd_rme32_capture_getrate(rme32, &dummy)) > 0) { 947 rate = 0; 948 if (rme32->rcreg & RME32_RCR_KMODE) 949 rate = snd_rme32_capture_getrate(rme32, &dummy); 950 if (rate > 0) { 937 951 /* AutoSync */ 938 952 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); … … 956 970 else 957 971 runtime->hw = snd_rme32_adat_info; 958 if ((rate = snd_rme32_capture_getrate(rme32, &isadat)) > 0) { 972 rate = snd_rme32_capture_getrate(rme32, &isadat); 973 if (rate > 0) { 959 974 if (!isadat) { 960 975 return -EIO; … … 1308 1323 spin_lock_init(&rme32->lock); 1309 1324 1310 if ((err = pci_enable_device(pci)) < 0) 1325 err = pci_enable_device(pci); 1326 if (err < 0) 1311 1327 return err; 1312 1328 1313 if ((err = pci_request_regions(pci, "RME32")) < 0) 1329 err = pci_request_regions(pci, "RME32"); 1330 if (err < 0) 1314 1331 return err; 1315 1332 rme32->port = pci_resource_start(rme32->pci, 0); … … 1335 1352 1336 1353 /* set up ALSA pcm device for S/PDIF */ 1337 if ((err = snd_pcm_new(rme32->card, "Digi32 IEC958", 0, 1, 1, &rme32->spdif_pcm)) < 0) { 1354 err = snd_pcm_new(rme32->card, "Digi32 IEC958", 0, 1, 1, &rme32->spdif_pcm); 1355 if (err < 0) 1338 1356 return err; 1339 }1340 1357 rme32->spdif_pcm->private_data = rme32; 1341 1358 rme32->spdif_pcm->private_free = snd_rme32_free_spdif_pcm; … … 1364 1381 } 1365 1382 else { 1366 if ((err = snd_pcm_new(rme32->card, "Digi32 ADAT", 1,1367 1, 1, &rme32->adat_pcm)) < 0)1368 {1383 err = snd_pcm_new(rme32->card, "Digi32 ADAT", 1, 1384 1, 1, &rme32->adat_pcm); 1385 if (err < 0) 1369 1386 return err; 1370 }1371 1387 rme32->adat_pcm->private_data = rme32; 1372 1388 rme32->adat_pcm->private_free = snd_rme32_free_adat_pcm; … … 1411 1427 1412 1428 /* init switch interface */ 1413 if ((err = snd_rme32_create_switches(rme32->card, rme32)) < 0) { 1429 err = snd_rme32_create_switches(rme32->card, rme32); 1430 if (err < 0) 1414 1431 return err; 1415 }1416 1432 1417 1433 /* init proc interface */ … … 1856 1872 1857 1873 for (idx = 0; idx < (int)ARRAY_SIZE(snd_rme32_controls); idx++) { 1858 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_rme32_controls[idx], rme32))) < 0) 1874 kctl = snd_ctl_new1(&snd_rme32_controls[idx], rme32); 1875 err = snd_ctl_add(card, kctl); 1876 if (err < 0) 1859 1877 return err; 1860 1878 if (idx == 1) /* IEC958 (S/PDIF) Stream */ … … 1900 1918 if (fullduplex[dev]) 1901 1919 rme32->fullduplex_mode = 1; 1902 if ((err = snd_rme32_create(rme32)) < 0) { 1920 err = snd_rme32_create(rme32); 1921 if (err < 0) { 1903 1922 snd_card_free(card); 1904 1923 return err; … … 1920 1939 card->shortname, rme32->rev, rme32->port, rme32->irq); 1921 1940 1922 if ((err = snd_card_register(card)) < 0) { 1941 err = snd_card_register(card); 1942 if (err < 0) { 1923 1943 snd_card_free(card); 1924 1944 return err; -
GPL/trunk/alsa-kernel/pci/rme96.c
r695 r703 667 667 668 668 if (!(rme96->wcreg & RME96_WCR_MASTER) && 669 snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG && 670 (rate = snd_rme96_capture_getrate(rme96, &dummy)) > 0) 671 { 672 /* slave clock */ 673 return rate; 674 } 669 snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG) { 670 rate = snd_rme96_capture_getrate(rme96, &dummy); 671 if (rate > 0) { 672 /* slave clock */ 673 return rate; 674 } 675 } 676 675 677 rate = ((rme96->wcreg >> RME96_WCR_BITPOS_FREQ_0) & 1) + 676 678 (((rme96->wcreg >> RME96_WCR_BITPOS_FREQ_1) & 1) << 1); … … 985 987 986 988 spin_lock_irq(&rme96->lock); 989 rate = 0; 987 990 if (!(rme96->wcreg & RME96_WCR_MASTER) && 988 snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG && 989 (rate = snd_rme96_capture_getrate(rme96, &dummy)) > 0)990 {991 snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG) 992 rate = snd_rme96_capture_getrate(rme96, &dummy); 993 if (rate > 0) { 991 994 /* slave clock */ 992 995 if ((int)params_rate(params) != rate) { … … 1047 1050 1048 1051 spin_lock_irq(&rme96->lock); 1049 if ((err = snd_rme96_capture_setformat(rme96, params_format(params))) < 0) { 1052 err = snd_rme96_capture_setformat(rme96, params_format(params)); 1053 if (err < 0) { 1050 1054 spin_unlock_irq(&rme96->lock); 1051 1055 return err; 1052 1056 } 1053 1057 if (snd_rme96_getinputtype(rme96) == RME96_INPUT_ANALOG) { 1054 if ((err = snd_rme96_capture_analog_setrate(rme96, 1055 params_rate(params))) < 0) 1056 { 1058 err = snd_rme96_capture_analog_setrate(rme96, params_rate(params)); 1059 if (err < 0) { 1057 1060 spin_unlock_irq(&rme96->lock); 1058 1061 return err; 1059 1062 } 1060 } else if ((rate = snd_rme96_capture_getrate(rme96, &isadat)) > 0) { 1061 if ((int)params_rate(params) != rate) { 1062 spin_unlock_irq(&rme96->lock); 1063 return -EIO; 1064 } 1065 if ((isadat && runtime->hw.channels_min == 2) || 1066 (!isadat && runtime->hw.channels_min == 8)) 1067 { 1068 spin_unlock_irq(&rme96->lock); 1069 return -EIO; 1070 } 1063 } else { 1064 rate = snd_rme96_capture_getrate(rme96, &isadat); 1065 if (rate > 0) { 1066 if ((int)params_rate(params) != rate) { 1067 spin_unlock_irq(&rme96->lock); 1068 return -EIO; 1069 } 1070 if ((isadat && runtime->hw.channels_min == 2) || 1071 (!isadat && runtime->hw.channels_min == 8)) { 1072 spin_unlock_irq(&rme96->lock); 1073 return -EIO; 1074 } 1075 } 1071 1076 } 1072 1077 snd_rme96_setframelog(rme96, params_channels(params), 0); … … 1161 1166 snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 1162 1167 RME96_BUFFER_SIZE); 1163 if ((size = rme96->playback_periodsize) != 0 || 1164 (size = rme96->capture_periodsize) != 0) 1168 size = rme96->playback_periodsize; 1169 if (!size) 1170 size = rme96->capture_periodsize; 1171 if (size) 1165 1172 snd_pcm_hw_constraint_single(runtime, 1166 1173 SNDRV_PCM_HW_PARAM_PERIOD_BYTES, … … 1192 1199 runtime->hw = snd_rme96_playback_spdif_info; 1193 1200 if (!(rme96->wcreg & RME96_WCR_MASTER) && 1194 snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG && 1195 (rate = snd_rme96_capture_getrate(rme96, &dummy)) > 0) 1196 { 1197 /* slave clock */ 1198 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); 1199 runtime->hw.rate_min = rate; 1200 runtime->hw.rate_max = rate; 1201 snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG) { 1202 rate = snd_rme96_capture_getrate(rme96, &dummy); 1203 if (rate > 0) { 1204 /* slave clock */ 1205 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); 1206 runtime->hw.rate_min = rate; 1207 runtime->hw.rate_max = rate; 1208 } 1201 1209 } 1202 1210 rme96_set_buffer_size_constraint(rme96, runtime); … … 1218 1226 snd_pcm_set_sync(substream); 1219 1227 runtime->hw = snd_rme96_capture_spdif_info; 1220 if (snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG && 1221 (rate = snd_rme96_capture_getrate(rme96, &isadat)) > 0) 1222 1223 if (isadat) { 1224 1225 } 1226 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);1227 runtime->hw.rate_min= rate;1228 runtime->hw.rate_max = rate; 1229 1228 if (snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG) { 1229 rate = snd_rme96_capture_getrate(rme96, &isadat); 1230 if (rate > 0) { 1231 if (isadat) 1232 return -EIO; 1233 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); 1234 runtime->hw.rate_min = rate; 1235 runtime->hw.rate_max = rate; 1236 } 1237 } 1230 1238 1231 1239 spin_lock_irq(&rme96->lock); … … 1261 1269 runtime->hw = snd_rme96_playback_adat_info; 1262 1270 if (!(rme96->wcreg & RME96_WCR_MASTER) && 1263 snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG && 1264 (rate = snd_rme96_capture_getrate(rme96, &dummy)) > 0) 1265 { 1266 /* slave clock */ 1267 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); 1268 runtime->hw.rate_min = rate; 1269 runtime->hw.rate_max = rate; 1270 } 1271 snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG) { 1272 rate = snd_rme96_capture_getrate(rme96, &dummy); 1273 if (rate > 0) { 1274 /* slave clock */ 1275 runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate); 1276 runtime->hw.rate_min = rate; 1277 runtime->hw.rate_max = rate; 1278 } 1279 } 1280 1271 1281 rme96_set_buffer_size_constraint(rme96, runtime); 1272 1282 return 0; … … 1287 1297 return -EIO; 1288 1298 } 1289 if ((rate = snd_rme96_capture_getrate(rme96, &isadat)) > 0) { 1299 rate = snd_rme96_capture_getrate(rme96, &isadat); 1300 if (rate > 0) { 1290 1301 if (!isadat) { 1291 1302 return -EIO; … … 1604 1615 spin_lock_init(&rme96->lock); 1605 1616 1606 if ((err = pci_enable_device(pci)) < 0) 1617 err = pci_enable_device(pci); 1618 if (err < 0) 1607 1619 return err; 1608 1620 1609 if ((err = pci_request_regions(pci, "RME96")) < 0) 1621 err = pci_request_regions(pci, "RME96"); 1622 if (err < 0) 1610 1623 return err; 1611 1624 rme96->port = pci_resource_start(rme96->pci, 0); … … 1631 1644 1632 1645 /* set up ALSA pcm device for S/PDIF */ 1633 if ((err = snd_pcm_new(rme96->card, "Digi96 IEC958", 0,1634 1, 1, &rme96->spdif_pcm)) < 0)1635 {1646 err = snd_pcm_new(rme96->card, "Digi96 IEC958", 0, 1647 1, 1, &rme96->spdif_pcm); 1648 if (err < 0) 1636 1649 return err; 1637 } 1650 1638 1651 rme96->spdif_pcm->private_data = rme96; 1639 1652 rme96->spdif_pcm->private_free = snd_rme96_free_spdif_pcm; … … 1649 1662 rme96->adat_pcm = NULL; 1650 1663 } else { 1651 if ((err = snd_pcm_new(rme96->card, "Digi96 ADAT", 1,1652 1, 1, &rme96->adat_pcm)) < 0)1653 {1664 err = snd_pcm_new(rme96->card, "Digi96 ADAT", 1, 1665 1, 1, &rme96->adat_pcm); 1666 if (err < 0) 1654 1667 return err; 1655 }1656 1668 rme96->adat_pcm->private_data = rme96; 1657 1669 rme96->adat_pcm->private_free = snd_rme96_free_adat_pcm; … … 1702 1714 1703 1715 /* init switch interface */ 1704 if ((err = snd_rme96_create_switches(rme96->card, rme96)) < 0) { 1716 err = snd_rme96_create_switches(rme96->card, rme96); 1717 if (err < 0) 1705 1718 return err; 1706 }1707 1719 1708 1720 /* init proc interface */ … … 2337 2349 2338 2350 for (idx = 0; idx < 7; idx++) { 2339 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_rme96_controls[idx], rme96))) < 0) 2351 kctl = snd_ctl_new1(&snd_rme96_controls[idx], rme96); 2352 err = snd_ctl_add(card, kctl); 2353 if (err < 0) 2340 2354 return err; 2341 2355 if (idx == 1) /* IEC958 (S/PDIF) Stream */ … … 2344 2358 2345 2359 if (RME96_HAS_ANALOG_OUT(rme96)) { 2346 for (idx = 7; idx < 10; idx++) 2347 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_rme96_controls[idx], rme96))) < 0) 2360 for (idx = 7; idx < 10; idx++) { 2361 err = snd_ctl_add(card, snd_ctl_new1(&snd_rme96_controls[idx], rme96)); 2362 if (err < 0) 2348 2363 return err; 2364 } 2349 2365 } 2350 2366 -
GPL/trunk/alsa-kernel/pci/rme9652/hdsp.c
r695 r703 290 290 return 110100480000000 / rate; // 105 MHz 291 291 */ 292 #define DDS_NUMERATOR 104857600000000ULL ;/* = 2^20 * 10^8 */292 #define DDS_NUMERATOR 104857600000000ULL /* = 2^20 * 10^8 */ 293 293 294 294 #define hdsp_encode_latency(x) (((x)<<1) & HDSP_LatencyMask) … … 1319 1319 if (hmidi->output) { 1320 1320 if (!snd_rawmidi_transmit_empty (hmidi->output)) { 1321 if ((n_pending = snd_hdsp_midi_output_possible (hmidi->hdsp, hmidi->id)) > 0) { 1321 n_pending = snd_hdsp_midi_output_possible(hmidi->hdsp, hmidi->id); 1322 if (n_pending > 0) { 1322 1323 if (n_pending > (int)sizeof (buf)) 1323 1324 n_pending = sizeof (buf); 1324 1325 1325 if ((to_write = snd_rawmidi_transmit (hmidi->output, buf, n_pending)) > 0) { 1326 to_write = snd_rawmidi_transmit(hmidi->output, buf, n_pending); 1327 if (to_write > 0) { 1326 1328 for (i = 0; i < to_write; ++i) 1327 1329 snd_hdsp_midi_write_byte (hmidi->hdsp, hmidi->id, buf[i]); … … 1342 1344 1343 1345 spin_lock_irqsave (&hmidi->lock, flags); 1344 if ((n_pending = snd_hdsp_midi_input_available (hmidi->hdsp, hmidi->id)) > 0) { 1346 n_pending = snd_hdsp_midi_input_available(hmidi->hdsp, hmidi->id); 1347 if (n_pending > 0) { 1345 1348 if (hmidi->input) { 1346 1349 if (n_pending > (int)sizeof (buf)) … … 3323 3326 3324 3327 for (idx = 0; idx < ARRAY_SIZE(snd_hdsp_controls); idx++) { 3325 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_hdsp_controls[idx], hdsp))) < 0) 3328 kctl = snd_ctl_new1(&snd_hdsp_controls[idx], hdsp); 3329 err = snd_ctl_add(card, kctl); 3330 if (err < 0) 3326 3331 return err; 3327 3332 if (idx == 1) /* IEC958 (S/PDIF) Stream */ … … 3332 3337 snd_hdsp_adat_sync_check.name = "ADAT Lock Status"; 3333 3338 snd_hdsp_adat_sync_check.index = 1; 3334 if ((err = snd_ctl_add (card, kctl = snd_ctl_new1(&snd_hdsp_adat_sync_check, hdsp)))) 3339 kctl = snd_ctl_new1(&snd_hdsp_adat_sync_check, hdsp); 3340 err = snd_ctl_add(card, kctl); 3341 if (err < 0) 3335 3342 return err; 3336 3343 if (hdsp->io_type == Digiface || hdsp->io_type == H9652) { 3337 3344 for (idx = 1; idx < 3; ++idx) { 3338 3345 snd_hdsp_adat_sync_check.index = idx+1; 3339 if ((err = snd_ctl_add (card, kctl = snd_ctl_new1(&snd_hdsp_adat_sync_check, hdsp)))) 3346 kctl = snd_ctl_new1(&snd_hdsp_adat_sync_check, hdsp); 3347 err = snd_ctl_add(card, kctl); 3348 if (err < 0) 3340 3349 return err; 3341 3350 } … … 3345 3354 if (hdsp->io_type == H9632) { 3346 3355 for (idx = 0; idx < ARRAY_SIZE(snd_hdsp_9632_controls); idx++) { 3347 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_hdsp_9632_controls[idx], hdsp))) < 0) 3356 kctl = snd_ctl_new1(&snd_hdsp_9632_controls[idx], hdsp); 3357 err = snd_ctl_add(card, kctl); 3358 if (err < 0) 3348 3359 return err; 3349 3360 } … … 3363 3374 /* AEB control for H96xx card */ 3364 3375 if (hdsp->io_type == H9632 || hdsp->io_type == H9652) { 3365 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_hdsp_96xx_aeb, hdsp))) < 0) 3366 return err; 3376 kctl = snd_ctl_new1(&snd_hdsp_96xx_aeb, hdsp); 3377 err = snd_ctl_add(card, kctl); 3378 if (err < 0) 3379 return err; 3367 3380 } 3368 3381 … … 3943 3956 return NULL; 3944 3957 3945 if ((mapped_channel = hdsp->channel_map[channel]) < 0) 3958 mapped_channel = hdsp->channel_map[channel]; 3959 if (mapped_channel < 0) 3946 3960 return NULL; 3947 3961 … … 4115 4129 spin_lock_irq(&hdsp->lock); 4116 4130 if (! hdsp->clock_source_locked) { 4117 if ((err = hdsp_set_rate(hdsp, params_rate(params), 0)) < 0) { 4131 err = hdsp_set_rate(hdsp, params_rate(params), 0); 4132 if (err < 0) { 4118 4133 spin_unlock_irq(&hdsp->lock); 4119 4134 _snd_pcm_hw_param_setempty(params, SNDRV_PCM_HW_PARAM_RATE); … … 4123 4138 spin_unlock_irq(&hdsp->lock); 4124 4139 4125 if ((err = hdsp_set_interrupt_interval(hdsp, params_period_size(params))) < 0) { 4140 err = hdsp_set_interrupt_interval(hdsp, params_period_size(params)); 4141 if (err < 0) { 4126 4142 _snd_pcm_hw_param_setempty(params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE); 4127 4143 return err; … … 4855 4871 if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return -EINVAL; 4856 4872 if (hdsp->io_type == Undefined) { 4857 if ((err = hdsp_get_iobox_version(hdsp)) < 0) 4873 err = hdsp_get_iobox_version(hdsp); 4874 if (err < 0) 4858 4875 return err; 4859 4876 } … … 4861 4878 hdsp_version.io_type = hdsp->io_type; 4862 4879 hdsp_version.firmware_rev = hdsp->firmware_rev; 4863 if ( (err = copy_to_user(argp, &hdsp_version, sizeof(hdsp_version))))4864 4880 if (copy_to_user(argp, &hdsp_version, sizeof(hdsp_version))) 4881 return -EFAULT; 4865 4882 break; 4866 4883 } … … 4901 4918 hdsp->state |= HDSP_FirmwareCached; 4902 4919 4903 if ((err = snd_hdsp_load_firmware_from_cache(hdsp)) < 0) 4920 err = snd_hdsp_load_firmware_from_cache(hdsp); 4921 if (err < 0) 4904 4922 return err; 4905 4923 4906 4924 if (!(hdsp->state & HDSP_InitializationComplete)) { 4907 if ((err = snd_hdsp_enable_io(hdsp)) < 0) 4925 err = snd_hdsp_enable_io(hdsp); 4926 if (err < 0) 4908 4927 return err; 4909 4928 … … 4911 4930 snd_hdsp_initialize_midi_flush(hdsp); 4912 4931 4913 if ((err = snd_hdsp_create_alsa_devices(hdsp->card, hdsp)) < 0) { 4932 err = snd_hdsp_create_alsa_devices(hdsp->card, hdsp); 4933 if (err < 0) { 4914 4934 dev_err(hdsp->card->dev, 4915 4935 "error creating alsa devices\n"); … … 4961 4981 int err; 4962 4982 4963 if ((err = snd_hwdep_new(card, "HDSP hwdep", 0, &hw)) < 0) 4983 err = snd_hwdep_new(card, "HDSP hwdep", 0, &hw); 4984 if (err < 0) 4964 4985 return err; 4965 4986 … … 4979 5000 int err; 4980 5001 4981 if ((err = snd_pcm_new(card, hdsp->card_name, 0, 1, 1, &pcm)) < 0) 5002 err = snd_pcm_new(card, hdsp->card_name, 0, 1, 1, &pcm); 5003 if (err < 0) 4982 5004 return err; 4983 5005 … … 5085 5107 int err; 5086 5108 5087 if ((err = snd_hdsp_create_pcm(card, hdsp)) < 0) { 5109 err = snd_hdsp_create_pcm(card, hdsp); 5110 if (err < 0) { 5088 5111 dev_err(card->dev, 5089 5112 "Error creating pcm interface\n"); … … 5092 5115 5093 5116 5094 if ((err = snd_hdsp_create_midi(card, hdsp, 0)) < 0) { 5117 err = snd_hdsp_create_midi(card, hdsp, 0); 5118 if (err < 0) { 5095 5119 dev_err(card->dev, 5096 5120 "Error creating first midi interface\n"); … … 5099 5123 5100 5124 if (hdsp->io_type == Digiface || hdsp->io_type == H9652) { 5101 if ((err = snd_hdsp_create_midi(card, hdsp, 1)) < 0) { 5125 err = snd_hdsp_create_midi(card, hdsp, 1); 5126 if (err < 0) { 5102 5127 dev_err(card->dev, 5103 5128 "Error creating second midi interface\n"); … … 5106 5131 } 5107 5132 5108 if ((err = snd_hdsp_create_controls(card, hdsp)) < 0) { 5133 err = snd_hdsp_create_controls(card, hdsp); 5134 if (err < 0) { 5109 5135 dev_err(card->dev, 5110 5136 "Error creating ctl interface\n"); … … 5120 5146 hdsp->playback_substream = NULL; 5121 5147 5122 if ((err = snd_hdsp_set_defaults(hdsp)) < 0) { 5148 err = snd_hdsp_set_defaults(hdsp); 5149 if (err < 0) { 5123 5150 dev_err(card->dev, 5124 5151 "Error setting default values\n"); … … 5131 5158 hdsp->port, hdsp->irq); 5132 5159 5133 if ((err = snd_card_register(card)) < 0) { 5160 err = snd_card_register(card); 5161 if (err < 0) { 5134 5162 dev_err(card->dev, 5135 5163 "error registering card\n"); … … 5152 5180 return 0; 5153 5181 if (hdsp->io_type == Undefined) { 5154 if ((err = hdsp_get_iobox_version(hdsp)) < 0) 5182 err = hdsp_get_iobox_version(hdsp); 5183 if (err < 0) 5155 5184 return err; 5156 5185 if (hdsp->io_type == H9652 || hdsp->io_type == H9632) … … 5198 5227 hdsp->state |= HDSP_FirmwareCached; 5199 5228 5200 if ((err = snd_hdsp_load_firmware_from_cache(hdsp)) < 0) 5229 err = snd_hdsp_load_firmware_from_cache(hdsp); 5230 if (err < 0) 5201 5231 return err; 5202 5232 5203 5233 if (!(hdsp->state & HDSP_InitializationComplete)) { 5204 if ((err = snd_hdsp_enable_io(hdsp)) < 0) 5234 err = snd_hdsp_enable_io(hdsp); 5235 if (err < 0) 5205 5236 return err; 5206 5237 5207 if ((err = snd_hdsp_create_hwdep(hdsp->card, hdsp)) < 0) { 5238 err = snd_hdsp_create_hwdep(hdsp->card, hdsp); 5239 if (err < 0) { 5208 5240 dev_err(hdsp->card->dev, 5209 5241 "error creating hwdep device\n"); … … 5212 5244 snd_hdsp_initialize_channels(hdsp); 5213 5245 snd_hdsp_initialize_midi_flush(hdsp); 5214 if ((err = snd_hdsp_create_alsa_devices(hdsp->card, hdsp)) < 0) { 5246 err = snd_hdsp_create_alsa_devices(hdsp->card, hdsp); 5247 if (err < 0) { 5215 5248 dev_err(hdsp->card->dev, 5216 5249 "error creating alsa devices\n"); … … 5281 5314 } 5282 5315 5283 if ((err = pci_enable_device(pci)) < 0) 5316 err = pci_enable_device(pci); 5317 if (err < 0) 5284 5318 return err; 5285 5319 5286 5320 pci_set_master(hdsp->pci); 5287 5321 5288 if ((err = pci_request_regions(pci, "hdsp")) < 0) 5322 err = pci_request_regions(pci, "hdsp"); 5323 if (err < 0) 5289 5324 return err; 5290 5325 hdsp->port = pci_resource_start(pci, 0); 5291 if ((hdsp->iobase = ioremap(hdsp->port, HDSP_IO_EXTENT)) == NULL) { 5326 hdsp->iobase = ioremap(hdsp->port, HDSP_IO_EXTENT); 5327 if (!hdsp->iobase) { 5292 5328 dev_err(hdsp->card->dev, "unable to remap region 0x%lx-0x%lx\n", 5293 5329 hdsp->port, hdsp->port + HDSP_IO_EXTENT - 1); … … 5307 5343 hdsp->dds_value = 0; 5308 5344 5309 if ((err = snd_hdsp_initialize_memory(hdsp)) < 0) 5345 err = snd_hdsp_initialize_memory(hdsp); 5346 if (err < 0) 5310 5347 return err; 5311 5348 … … 5319 5356 5320 5357 if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) { 5321 if ((err = hdsp_request_fw_loader(hdsp)) < 0) 5358 err = hdsp_request_fw_loader(hdsp); 5359 if (err < 0) 5322 5360 /* we don't fail as this can happen 5323 5361 if userspace is not ready for … … 5332 5370 dev_info(hdsp->card->dev, 5333 5371 "card initialization pending : waiting for firmware\n"); 5334 if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0) 5372 err = snd_hdsp_create_hwdep(card, hdsp); 5373 if (err < 0) 5335 5374 return err; 5336 5375 return 0; … … 5347 5386 } 5348 5387 5349 if ((err = snd_hdsp_enable_io(hdsp)) != 0) 5388 err = snd_hdsp_enable_io(hdsp); 5389 if (err) 5350 5390 return err; 5351 5391 … … 5356 5396 hdsp->io_type = H9632; 5357 5397 5358 if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0) 5398 err = snd_hdsp_create_hwdep(card, hdsp); 5399 if (err < 0) 5359 5400 return err; 5360 5401 … … 5364 5405 hdsp->state |= HDSP_FirmwareLoaded; 5365 5406 5366 if ((err = snd_hdsp_create_alsa_devices(card, hdsp)) < 0) 5407 err = snd_hdsp_create_alsa_devices(card, hdsp); 5408 if (err < 0) 5367 5409 return err; 5368 5410 -
GPL/trunk/alsa-kernel/pci/rme9652/rme9652.c
r695 r703 434 434 spin_lock_irq(&s->lock); 435 435 436 if ((restart = s->running)) { 436 restart = s->running; 437 if (restart) 437 438 rme9652_stop(s); 438 }439 439 440 440 frames >>= 7; … … 519 519 } 520 520 521 if ((restart = rme9652->running)) { 521 restart = rme9652->running; 522 if (restart) 522 523 rme9652_stop(rme9652); 523 }524 524 rme9652->control_register &= ~(RME9652_freq | RME9652_DS); 525 525 rme9652->control_register |= rate; 526 526 rme9652_write(rme9652, RME9652_control_register, rme9652->control_register); 527 527 528 if (restart) {528 if (restart) 529 529 rme9652_start(rme9652); 530 }531 530 532 531 if (rate & RME9652_DS) { … … 879 878 /* XXX do we actually need to stop the card when we do this ? */ 880 879 881 if ((restart = rme9652->running)) { 880 restart = rme9652->running; 881 if (restart) 882 882 rme9652_stop(rme9652); 883 }884 883 885 884 rme9652_write(rme9652, RME9652_control_register, rme9652->control_register); 886 885 887 if (restart) {886 if (restart) 888 887 rme9652_start(rme9652); 889 }890 888 891 889 return 0; … … 944 942 rme9652->control_register |= rme9652_encode_spdif_in(in); 945 943 946 if ((restart = rme9652->running)) { 944 restart = rme9652->running; 945 if (restart) 947 946 rme9652_stop(rme9652); 948 }949 947 950 948 rme9652_write(rme9652, RME9652_control_register, rme9652->control_register); 951 949 952 if (restart) {950 if (restart) 953 951 rme9652_start(rme9652); 954 }955 952 956 953 return 0; … … 1011 1008 } 1012 1009 1013 if ((restart = rme9652->running)) { 1010 restart = rme9652->running; 1011 if (restart) 1014 1012 rme9652_stop(rme9652); 1015 }1016 1013 1017 1014 rme9652_write(rme9652, RME9652_control_register, rme9652->control_register); 1018 1015 1019 if (restart) {1016 if (restart) 1020 1017 rme9652_start(rme9652); 1021 }1022 1018 1023 1019 return 0; … … 1087 1083 } 1088 1084 1089 if ((restart = rme9652->running)) { 1085 restart = rme9652->running; 1086 if (restart) 1090 1087 rme9652_stop(rme9652); 1091 }1092 1088 1093 1089 rme9652_write(rme9652, RME9652_control_register, rme9652->control_register); 1094 1090 1095 if (restart) {1091 if (restart) 1096 1092 rme9652_start(rme9652); 1097 }1098 1093 1099 1094 return 0; … … 1174 1169 } 1175 1170 1176 if ((restart = rme9652->running)) { 1171 restart = rme9652->running; 1172 if (restart) 1177 1173 rme9652_stop(rme9652); 1178 }1179 1174 1180 1175 rme9652_write(rme9652, RME9652_control_register, rme9652->control_register); 1181 1176 1182 if (restart) {1177 if (restart) 1183 1178 rme9652_start(rme9652); 1184 }1185 1179 1186 1180 return 0; … … 1514 1508 1515 1509 for (idx = 0; idx < ARRAY_SIZE(snd_rme9652_controls); idx++) { 1516 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_rme9652_controls[idx], rme9652))) < 0) 1510 kctl = snd_ctl_new1(&snd_rme9652_controls[idx], rme9652); 1511 err = snd_ctl_add(card, kctl); 1512 if (err < 0) 1517 1513 return err; 1518 1514 if (idx == 1) /* IEC958 (S/PDIF) Stream */ … … 1520 1516 } 1521 1517 1522 if (rme9652->ss_channels == RME9652_NCHANNELS) 1523 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_rme9652_adat3_check, rme9652))) < 0) 1518 if (rme9652->ss_channels == RME9652_NCHANNELS) { 1519 kctl = snd_ctl_new1(&snd_rme9652_adat3_check, rme9652); 1520 err = snd_ctl_add(card, kctl); 1521 if (err < 0) 1524 1522 return err; 1525 1526 if (rme9652->hw_rev >= 15) 1527 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_rme9652_adat1_input, rme9652))) < 0) 1523 } 1524 1525 if (rme9652->hw_rev >= 15) { 1526 kctl = snd_ctl_new1(&snd_rme9652_adat1_input, rme9652); 1527 err = snd_ctl_add(card, kctl); 1528 if (err < 0) 1528 1529 return err; 1530 } 1529 1531 1530 1532 return 0; … … 1843 1845 return NULL; 1844 1846 1845 if ((mapped_channel = rme9652->channel_map[channel]) < 0) { 1847 mapped_channel = rme9652->channel_map[channel]; 1848 if (mapped_channel < 0) 1846 1849 return NULL; 1847 }1848 1850 1849 1851 if (stream == SNDRV_PCM_STREAM_CAPTURE) { … … 2022 2024 */ 2023 2025 2024 if ((err = rme9652_set_rate(rme9652, params_rate(params))) < 0) { 2026 err = rme9652_set_rate(rme9652, params_rate(params)); 2027 if (err < 0) { 2025 2028 _snd_pcm_hw_param_setempty(params, SNDRV_PCM_HW_PARAM_RATE); 2026 2029 return err; 2027 2030 } 2028 2031 2029 if ((err = rme9652_set_interrupt_interval(rme9652, params_period_size(params))) < 0) { 2032 err = rme9652_set_interrupt_interval(rme9652, params_period_size(params)); 2033 if (err < 0) { 2030 2034 _snd_pcm_hw_param_setempty(params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE); 2031 2035 return err; … … 2407 2411 int err; 2408 2412 2409 if ((err = snd_pcm_new(card, 2410 rme9652->card_name, 2411 0, 1, 1, &pcm)) < 0) { 2413 err = snd_pcm_new(card, rme9652->card_name, 0, 1, 1, &pcm); 2414 if (err < 0) 2412 2415 return err; 2413 }2414 2416 2415 2417 rme9652->pcm = pcm; … … 2451 2453 } 2452 2454 2453 if ((err = pci_enable_device(pci)) < 0) 2455 err = pci_enable_device(pci); 2456 if (err < 0) 2454 2457 return err; 2455 2458 2456 2459 spin_lock_init(&rme9652->lock); 2457 2460 2458 if ((err = pci_request_regions(pci, "rme9652")) < 0) 2461 err = pci_request_regions(pci, "rme9652"); 2462 if (err < 0) 2459 2463 return err; 2460 2464 rme9652->port = pci_resource_start(pci, 0); … … 2529 2533 pci_set_master(rme9652->pci); 2530 2534 2531 if ((err = snd_rme9652_initialize_memory(rme9652)) < 0) { 2535 err = snd_rme9652_initialize_memory(rme9652); 2536 if (err < 0) 2532 2537 return err; 2533 } 2534 2535 if ( (err = snd_rme9652_create_pcm(card, rme9652)) < 0) {2538 2539 err = snd_rme9652_create_pcm(card, rme9652); 2540 if (err < 0) 2536 2541 return err; 2537 } 2538 2539 if ( (err = snd_rme9652_create_controls(card, rme9652)) < 0) {2542 2543 err = snd_rme9652_create_controls(card, rme9652); 2544 if (err < 0) 2540 2545 return err; 2541 }2542 2546 2543 2547 snd_rme9652_proc_init(rme9652); -
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; -
GPL/trunk/alsa-kernel/pci/trident/trident.c
r695 r703 77 77 return err; 78 78 79 if ((err = snd_trident_create(card, pci, 80 pcm_channels[dev], 81 ((pci->vendor << 16) | pci->device) == TRIDENT_DEVICE_ID_SI7018 ? 1 : 2, 82 wavetable_size[dev], 83 &trident)) < 0) { 79 err = snd_trident_create(card, pci, 80 pcm_channels[dev], 81 ((pci->vendor << 16) | pci->device) == TRIDENT_DEVICE_ID_SI7018 ? 1 : 2, 82 wavetable_size[dev], 83 &trident); 84 if (err < 0) { 84 85 snd_card_free(card); 85 86 return err; … … 110 111 card->shortname, trident->port, trident->irq); 111 112 112 if ((err = snd_trident_pcm(trident, pcm_dev++)) < 0) { 113 err = snd_trident_pcm(trident, pcm_dev++); 114 if (err < 0) { 113 115 snd_card_free(card); 114 116 return err; … … 117 119 case TRIDENT_DEVICE_ID_DX: 118 120 case TRIDENT_DEVICE_ID_NX: 119 if ((err = snd_trident_foldback_pcm(trident, pcm_dev++)) < 0) { 121 err = snd_trident_foldback_pcm(trident, pcm_dev++); 122 if (err < 0) { 120 123 snd_card_free(card); 121 124 return err; … … 124 127 } 125 128 if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) { 126 if ((err = snd_trident_spdif_pcm(trident, pcm_dev++)) < 0) { 129 err = snd_trident_spdif_pcm(trident, pcm_dev++); 130 if (err < 0) { 127 131 snd_card_free(card); 128 132 return err; 129 133 } 130 134 } 131 if (trident->device != TRIDENT_DEVICE_ID_SI7018 && 132 (err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE, 133 trident->midi_port, 134 MPU401_INFO_INTEGRATED | 135 MPU401_INFO_IRQ_HOOK, 136 -1, &trident->rmidi)) < 0) { 137 snd_card_free(card); 138 return err; 135 if (trident->device != TRIDENT_DEVICE_ID_SI7018) { 136 err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE, 137 trident->midi_port, 138 MPU401_INFO_INTEGRATED | 139 MPU401_INFO_IRQ_HOOK, 140 -1, &trident->rmidi); 141 if (err < 0) { 142 snd_card_free(card); 143 return err; 144 } 139 145 } 140 146 141 147 snd_trident_create_gameport(trident); 142 148 143 if ((err = snd_card_register(card)) < 0) { 149 err = snd_card_register(card); 150 if (err < 0) { 144 151 snd_card_free(card); 145 152 return err; -
GPL/trunk/alsa-kernel/pci/trident/trident.h
r679 r703 252 252 __le32 *entries; /* 16k-aligned TLB table */ 253 253 dma_addr_t entries_dmaaddr; /* 16k-aligned PCI address to TLB table */ 254 unsigned long * shadow_entries; /* shadow entries with virtual addresses */255 254 struct snd_dma_buffer buffer; 256 255 struct snd_util_memhdr * memhdr; /* page allocation list */ -
GPL/trunk/alsa-kernel/pci/trident/trident_main.c
r695 r703 2132 2132 int err; 2133 2133 2134 if ((err = snd_pcm_new(trident->card, "trident_dx_nx", device, trident->ChanPCM, 1, &pcm)) < 0) 2134 err = snd_pcm_new(trident->card, "trident_dx_nx", device, trident->ChanPCM, 1, &pcm); 2135 if (err < 0) 2135 2136 return err; 2136 2137 … … 2191 2192 if (trident->device == TRIDENT_DEVICE_ID_NX) 2192 2193 num_chan = 4; 2193 if ((err = snd_pcm_new(trident->card, "trident_dx_nx", device, 0, num_chan, &foldback)) < 0) 2194 err = snd_pcm_new(trident->card, "trident_dx_nx", device, 0, num_chan, &foldback); 2195 if (err < 0) 2194 2196 return err; 2195 2197 … … 2241 2243 int err; 2242 2244 2243 if ((err = snd_pcm_new(trident->card, "trident_dx_nx IEC958", device, 1, 0, &spdif)) < 0) 2245 err = snd_pcm_new(trident->card, "trident_dx_nx IEC958", device, 1, 0, &spdif); 2246 if (err < 0) 2244 2247 return err; 2245 2248 … … 2934 2937 return -ENOMEM; 2935 2938 2936 if ((err = snd_ac97_bus(trident->card, 0, &ops, NULL, &trident->ac97_bus)) < 0) 2939 err = snd_ac97_bus(trident->card, 0, &ops, NULL, &trident->ac97_bus); 2940 if (err < 0) 2937 2941 goto __out; 2938 2942 … … 2942 2946 2943 2947 __again: 2944 if ((err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97)) < 0) { 2948 err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97); 2949 if (err < 0) { 2945 2950 if (trident->device == TRIDENT_DEVICE_ID_SI7018) { 2946 if ((err = snd_trident_sis_reset(trident)) < 0) 2951 err = snd_trident_sis_reset(trident); 2952 if (err < 0) 2947 2953 goto __out; 2948 2954 if (retries-- > 0) … … 2975 2981 2976 2982 if (trident->device != TRIDENT_DEVICE_ID_SI7018) { 2977 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_trident_vol_wave_control, trident))) < 0) 2983 kctl = snd_ctl_new1(&snd_trident_vol_wave_control, trident); 2984 err = snd_ctl_add(card, kctl); 2985 if (err < 0) 2978 2986 goto __out; 2979 2987 kctl->put(kctl, uctl); 2980 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_trident_vol_music_control, trident))) < 0) 2988 kctl = snd_ctl_new1(&snd_trident_vol_music_control, trident); 2989 err = snd_ctl_add(card, kctl); 2990 if (err < 0) 2981 2991 goto __out; 2982 2992 kctl->put(kctl, uctl); … … 2992 3002 tmix->voice = NULL; 2993 3003 } 2994 if ((trident->ctl_vol = snd_ctl_new1(&snd_trident_pcm_vol_control, trident)) == NULL) 3004 trident->ctl_vol = snd_ctl_new1(&snd_trident_pcm_vol_control, trident); 3005 if (!trident->ctl_vol) 2995 3006 goto __nomem; 2996 if ((err = snd_ctl_add(card, trident->ctl_vol))) 3007 err = snd_ctl_add(card, trident->ctl_vol); 3008 if (err) 2997 3009 goto __out; 2998 3010 2999 if ((trident->ctl_pan = snd_ctl_new1(&snd_trident_pcm_pan_control, trident)) == NULL) 3011 trident->ctl_pan = snd_ctl_new1(&snd_trident_pcm_pan_control, trident); 3012 if (!trident->ctl_pan) 3000 3013 goto __nomem; 3001 if ((err = snd_ctl_add(card, trident->ctl_pan))) 3014 err = snd_ctl_add(card, trident->ctl_pan); 3015 if (err) 3002 3016 goto __out; 3003 3017 3004 if ((trident->ctl_rvol = snd_ctl_new1(&snd_trident_pcm_rvol_control, trident)) == NULL) 3018 trident->ctl_rvol = snd_ctl_new1(&snd_trident_pcm_rvol_control, trident); 3019 if (!trident->ctl_rvol) 3005 3020 goto __nomem; 3006 if ((err = snd_ctl_add(card, trident->ctl_rvol))) 3021 err = snd_ctl_add(card, trident->ctl_rvol); 3022 if (err) 3007 3023 goto __out; 3008 3024 3009 if ((trident->ctl_cvol = snd_ctl_new1(&snd_trident_pcm_cvol_control, trident)) == NULL) 3025 trident->ctl_cvol = snd_ctl_new1(&snd_trident_pcm_cvol_control, trident); 3026 if (!trident->ctl_cvol) 3010 3027 goto __nomem; 3011 if ((err = snd_ctl_add(card, trident->ctl_cvol))) 3028 err = snd_ctl_add(card, trident->ctl_cvol); 3029 if (err) 3012 3030 goto __out; 3013 3031 3014 3032 if (trident->device == TRIDENT_DEVICE_ID_NX) { 3015 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_trident_ac97_rear_control, trident))) < 0) 3033 kctl = snd_ctl_new1(&snd_trident_ac97_rear_control, trident); 3034 err = snd_ctl_add(card, kctl); 3035 if (err < 0) 3016 3036 goto __out; 3017 3037 kctl->put(kctl, uctl); … … 3029 3049 kctl->id.index++; 3030 3050 idx = kctl->id.index; 3031 if ((err = snd_ctl_add(card, kctl)) < 0) 3051 err = snd_ctl_add(card, kctl); 3052 if (err < 0) 3032 3053 goto __out; 3033 3054 kctl->put(kctl, uctl); … … 3040 3061 kctl->id.index = idx; 3041 3062 kctl->id.device = pcm_spdif_device; 3042 if ((err = snd_ctl_add(card, kctl)) < 0) 3063 err = snd_ctl_add(card, kctl); 3064 if (err < 0) 3043 3065 goto __out; 3044 3066 … … 3050 3072 kctl->id.index = idx; 3051 3073 kctl->id.device = pcm_spdif_device; 3052 if ((err = snd_ctl_add(card, kctl)) < 0) 3074 err = snd_ctl_add(card, kctl); 3075 if (err < 0) 3053 3076 goto __out; 3054 3077 … … 3060 3083 kctl->id.index = idx; 3061 3084 kctl->id.device = pcm_spdif_device; 3062 if ((err = snd_ctl_add(card, kctl)) < 0) 3085 err = snd_ctl_add(card, kctl); 3086 if (err < 0) 3063 3087 goto __out; 3064 3088 trident->spdif_pcm_ctl = kctl; … … 3320 3344 trident->tlb.entries = (__le32 *)ALIGN((unsigned long)trident->tlb.buffer.area, SNDRV_TRIDENT_MAX_PAGES * 4); 3321 3345 trident->tlb.entries_dmaaddr = ALIGN(trident->tlb.buffer.addr, SNDRV_TRIDENT_MAX_PAGES * 4); 3322 /* allocate shadow TLB page table (virtual addresses) */3323 trident->tlb.shadow_entries =3324 vmalloc(array_size(SNDRV_TRIDENT_MAX_PAGES,3325 sizeof(unsigned long)));3326 if (!trident->tlb.shadow_entries)3327 return -ENOMEM;3328 3346 3329 3347 /* allocate and setup silent page and initialise TLB entries */ … … 3334 3352 } 3335 3353 memset(trident->tlb.silent_page.area, 0, SNDRV_TRIDENT_PAGE_SIZE); 3336 for (i = 0; i < SNDRV_TRIDENT_MAX_PAGES; i++) {3354 for (i = 0; i < SNDRV_TRIDENT_MAX_PAGES; i++) 3337 3355 trident->tlb.entries[i] = cpu_to_le32(trident->tlb.silent_page.addr & ~(SNDRV_TRIDENT_PAGE_SIZE-1)); 3338 trident->tlb.shadow_entries[i] = (unsigned long)trident->tlb.silent_page.area;3339 }3340 3356 3341 3357 /* use emu memory block manager code to manage tlb page allocation */ … … 3462 3478 int err; 3463 3479 3464 if ((err = snd_trident_sis_reset(trident)) < 0) 3480 err = snd_trident_sis_reset(trident); 3481 if (err < 0) 3465 3482 return err; 3466 3483 … … 3507 3524 3508 3525 /* enable PCI device */ 3509 if ((err = pci_enable_device(pci)) < 0) 3526 err = pci_enable_device(pci); 3527 if (err < 0) 3510 3528 return err; 3511 3529 /* check, if we can restrict PCI DMA transfers to 30 bits */ … … 3541 3559 pci_set_master(pci); 3542 3560 3543 if ((err = pci_request_regions(pci, "Trident Audio")) < 0) { 3561 err = pci_request_regions(pci, "Trident Audio"); 3562 if (err < 0) { 3544 3563 kfree(trident); 3545 3564 pci_disable_device(pci); … … 3561 3580 trident->tlb.buffer.area = NULL; 3562 3581 if (trident->device == TRIDENT_DEVICE_ID_NX) { 3563 if ((err = snd_trident_tlb_alloc(trident)) < 0) { 3582 err = snd_trident_tlb_alloc(trident); 3583 if (err < 0) { 3564 3584 snd_trident_free(trident); 3565 3585 return err; … … 3589 3609 } 3590 3610 3591 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, trident, &ops)) < 0) { 3611 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, trident, &ops); 3612 if (err < 0) { 3592 3613 snd_trident_free(trident); 3593 3614 return err; 3594 3615 } 3595 3616 3596 if ((err = snd_trident_mixer(trident, pcm_spdif_device)) < 0) 3617 err = snd_trident_mixer(trident, pcm_spdif_device); 3618 if (err < 0) 3597 3619 return err; 3598 3620 … … 3648 3670 if (trident->tlb.silent_page.area) 3649 3671 snd_dma_free_pages(&trident->tlb.silent_page); 3650 vfree(trident->tlb.shadow_entries);3651 3672 snd_dma_free_pages(&trident->tlb.buffer); 3652 3673 } -
GPL/trunk/alsa-kernel/pci/trident/trident_memory.c
r679 r703 20 20 * aligned pages in others 21 21 */ 22 #define __set_tlb_bus(trident,page,ptr,addr) \ 23 do { (trident)->tlb.entries[page] = cpu_to_le32((addr) & ~(SNDRV_TRIDENT_PAGE_SIZE-1)); \ 24 (trident)->tlb.shadow_entries[page] = (ptr); } while (0) 25 #define __tlb_to_ptr(trident,page) \ 26 (void*)((trident)->tlb.shadow_entries[page]) 22 #define __set_tlb_bus(trident,page,addr) \ 23 (trident)->tlb.entries[page] = cpu_to_le32((addr) & ~(SNDRV_TRIDENT_PAGE_SIZE-1)) 27 24 #define __tlb_to_addr(trident,page) \ 28 25 (dma_addr_t)le32_to_cpu((trident->tlb.entries[page]) & ~(SNDRV_TRIDENT_PAGE_SIZE - 1)) … … 33 30 #define MAX_ALIGN_PAGES SNDRV_TRIDENT_MAX_PAGES /* maxmium aligned pages */ 34 31 /* fill TLB entrie(s) corresponding to page with ptr */ 35 #define set_tlb_bus(trident,page, ptr,addr) __set_tlb_bus(trident,page,ptr,addr)32 #define set_tlb_bus(trident,page,addr) __set_tlb_bus(trident,page,addr) 36 33 /* fill TLB entrie(s) corresponding to page with silence pointer */ 37 #define set_silent_tlb(trident,page) __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area,trident->tlb.silent_page.addr)34 #define set_silent_tlb(trident,page) __set_tlb_bus(trident, page, trident->tlb.silent_page.addr) 38 35 /* get aligned page from offset address */ 39 36 #define get_aligned_page(offset) ((offset) >> 12) 40 37 /* get offset address from aligned page */ 41 38 #define aligned_page_offset(page) ((page) << 12) 42 /* get buffer address from aligned page */43 #define page_to_ptr(trident,page) __tlb_to_ptr(trident, page)44 39 /* get PCI physical address from aligned page */ 45 40 #define page_to_addr(trident,page) __tlb_to_addr(trident, page) … … 51 46 #define get_aligned_page(offset) ((offset) >> 13) 52 47 #define aligned_page_offset(page) ((page) << 13) 53 #define page_to_ptr(trident,page) __tlb_to_ptr(trident, (page) << 1)54 48 #define page_to_addr(trident,page) __tlb_to_addr(trident, (page) << 1) 55 49 56 50 /* fill TLB entries -- we need to fill two entries */ 57 51 static inline void set_tlb_bus(struct snd_trident *trident, int page, 58 unsigned long ptr,dma_addr_t addr)52 dma_addr_t addr) 59 53 { 60 54 page <<= 1; 61 __set_tlb_bus(trident, page, ptr,addr);62 __set_tlb_bus(trident, page+1, ptr + SNDRV_TRIDENT_PAGE_SIZE,addr + SNDRV_TRIDENT_PAGE_SIZE);55 __set_tlb_bus(trident, page, addr); 56 __set_tlb_bus(trident, page+1, addr + SNDRV_TRIDENT_PAGE_SIZE); 63 57 } 64 58 static inline void set_silent_tlb(struct snd_trident *trident, int page) 65 59 { 66 60 page <<= 1; 67 __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area,trident->tlb.silent_page.addr);68 __set_tlb_bus(trident, page+1, (unsigned long)trident->tlb.silent_page.area,trident->tlb.silent_page.addr);61 __set_tlb_bus(trident, page, trident->tlb.silent_page.addr); 62 __set_tlb_bus(trident, page+1, trident->tlb.silent_page.addr); 69 63 } 70 64 … … 81 75 #define get_aligned_page(offset) ((offset) / ALIGN_PAGE_SIZE) 82 76 #define aligned_page_offset(page) ((page) * ALIGN_PAGE_SIZE) 83 #define page_to_ptr(trident,page) __tlb_to_ptr(trident, (page) * UNIT_PAGES)84 77 #define page_to_addr(trident,page) __tlb_to_addr(trident, (page) * UNIT_PAGES) 85 78 86 79 /* fill TLB entries -- UNIT_PAGES entries must be filled */ 87 80 static inline void set_tlb_bus(struct snd_trident *trident, int page, 88 unsigned long ptr,dma_addr_t addr)81 dma_addr_t addr) 89 82 { 90 83 int i; 91 84 page *= UNIT_PAGES; 92 85 for (i = 0; i < UNIT_PAGES; i++, page++) { 93 __set_tlb_bus(trident, page, ptr, addr); 94 ptr += SNDRV_TRIDENT_PAGE_SIZE; 86 __set_tlb_bus(trident, page, addr); 95 87 addr += SNDRV_TRIDENT_PAGE_SIZE; 96 88 } … … 101 93 page *= UNIT_PAGES; 102 94 for (i = 0; i < UNIT_PAGES; i++, page++) 103 __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area,trident->tlb.silent_page.addr);95 __set_tlb_bus(trident, page, trident->tlb.silent_page.addr); 104 96 } 105 97 106 98 #endif /* PAGE_SIZE */ 107 108 /* calculate buffer pointer from offset address */109 static inline void *offset_ptr(struct snd_trident *trident, int offset)110 {111 char *ptr;112 ptr = page_to_ptr(trident, get_aligned_page(offset));113 ptr += offset % ALIGN_PAGE_SIZE;114 return (void*)ptr;115 }116 99 117 100 /* first and last (aligned) pages of memory block */ … … 204 187 unsigned long ofs = idx << PAGE_SHIFT; 205 188 dma_addr_t addr = snd_pcm_sgbuf_get_addr(substream, ofs); 206 unsigned long ptr = (unsigned long)207 snd_pcm_sgbuf_get_ptr(substream, ofs);208 189 if (! is_valid_page(addr)) { 209 190 __snd_util_mem_free(hdr, blk); … … 211 192 return NULL; 212 193 } 213 set_tlb_bus(trident, page, ptr,addr);194 set_tlb_bus(trident, page, addr); 214 195 } 215 196 mutex_unlock(&hdr->block_mutex); … … 229 210 struct snd_pcm_runtime *runtime = substream->runtime; 230 211 dma_addr_t addr; 231 unsigned long ptr;232 212 233 213 #pragma disable_message (136) … … 250 230 /* set TLB entries */ 251 231 addr = runtime->dma_addr; 252 ptr = (unsigned long)runtime->dma_area;253 232 for (page = firstpg(blk); page <= lastpg(blk); page++, 254 ptr += SNDRV_TRIDENT_PAGE_SIZE,addr += SNDRV_TRIDENT_PAGE_SIZE) {233 addr += SNDRV_TRIDENT_PAGE_SIZE) { 255 234 if (! is_valid_page(addr)) { 256 235 __snd_util_mem_free(hdr, blk); … … 258 237 return NULL; 259 238 } 260 set_tlb_bus(trident, page, ptr,addr);239 set_tlb_bus(trident, page, addr); 261 240 } 262 241 mutex_unlock(&hdr->block_mutex); -
GPL/trunk/alsa-kernel/pci/via82xx.c
r695 r703 520 520 while (timeout-- > 0) { 521 521 udelay(1); 522 if (!((val = snd_via82xx_codec_xread(chip)) & VIA_REG_AC97_BUSY)) 522 val = snd_via82xx_codec_xread(chip); 523 if (!(val & VIA_REG_AC97_BUSY)) 523 524 return val & 0xffff; 524 525 } … … 1028 1029 u32 rbits; 1029 1030 1030 if ((rate_changed = via_lock_rate(&chip->rates[0], ac97_rate)) < 0) 1031 rate_changed = via_lock_rate(&chip->rates[0], ac97_rate); 1032 if (rate_changed < 0) 1031 1033 return rate_changed; 1032 1034 if (rate_changed) … … 1202 1204 /* we may remove following constaint when we modify table entries 1203 1205 in interrupt */ 1204 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 1206 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 1207 if (err < 0) 1205 1208 return err; 1206 1209 … … 1227 1230 int err; 1228 1231 1229 if ((err = snd_via82xx_pcm_open(chip, viadev, substream)) < 0) 1232 err = snd_via82xx_pcm_open(chip, viadev, substream); 1233 if (err < 0) 1230 1234 return err; 1231 1235 return 0; … … 1243 1247 1244 1248 viadev = &chip->devs[chip->playback_devno + substream->number]; 1245 if ((err = snd_via82xx_pcm_open(chip, viadev, substream)) < 0) 1249 err = snd_via82xx_pcm_open(chip, viadev, substream); 1250 if (err < 0) 1246 1251 return err; 1247 1252 stream = viadev->reg_offset / 0x10; … … 1280 1285 }; 1281 1286 1282 if ((err = snd_via82xx_pcm_open(chip, viadev, substream)) < 0) 1287 err = snd_via82xx_pcm_open(chip, viadev, substream); 1288 if (err < 0) 1283 1289 return err; 1284 1290 substream->runtime->hw.channels_max = 6; … … 1880 1886 }; 1881 1887 1882 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus)) < 0) 1888 err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus); 1889 if (err < 0) 1883 1890 return err; 1884 1891 chip->ac97_bus->private_free = snd_via82xx_mixer_free_ac97_bus; … … 1890 1897 ac97.pci = chip->pci; 1891 1898 ac97.scaps = AC97_SCAP_SKIP_MODEM | AC97_SCAP_POWER_SAVE; 1892 if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97)) < 0) 1899 err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97); 1900 if (err < 0) 1893 1901 return err; 1894 1902 … … 2059 2067 } 2060 2068 } 2061 if (mpu_port >= 0x200 &&2062 (chip->mpu_res = request_region(mpu_port, 2, "VIA82xx MPU401"))2063 != NULL) {2069 if (mpu_port >= 0x200) 2070 chip->mpu_res = request_region(mpu_port, 2, "VIA82xx MPU401"); 2071 if (chip->mpu_res) { 2064 2072 if (rev_h) 2065 2073 legacy |= VIA_FUNC_MIDI_PNP; /* enable PCI I/O 2 */ … … 2178 2186 } while (time_before(jiffies, end_time)); 2179 2187 2180 if ((val = snd_via82xx_codec_xread(chip)) & VIA_REG_AC97_BUSY) 2188 val = snd_via82xx_codec_xread(chip); 2189 if (val & VIA_REG_AC97_BUSY) 2181 2190 dev_err(chip->card->dev, 2182 2191 "AC'97 codec is not ready [0x%x]\n", val); … … 2191 2200 (VIA_REG_AC97_CODEC_ID_SECONDARY << VIA_REG_AC97_CODEC_ID_SHIFT)); 2192 2201 do { 2193 if ((val = snd_via82xx_codec_xread(chip)) & VIA_REG_AC97_SECONDARY_VALID) { 2202 val = snd_via82xx_codec_xread(chip); 2203 if (val & VIA_REG_AC97_SECONDARY_VALID) { 2194 2204 chip->ac97_secondary = 1; 2195 2205 goto __ac97_ok2; … … 2342 2352 }; 2343 2353 2344 if ((err = pci_enable_device(pci)) < 0) 2354 err = pci_enable_device(pci); 2355 if (err < 0) 2345 2356 return err; 2346 2357 2347 if ((chip = kzalloc(sizeof(*chip), GFP_KERNEL)) == NULL) { 2358 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 2359 if (!chip) { 2348 2360 pci_disable_device(pci); 2349 2361 return -ENOMEM; … … 2365 2377 chip->old_legacy & ~(VIA_FUNC_ENABLE_SB|VIA_FUNC_ENABLE_FM)); 2366 2378 2367 if ((err = pci_request_regions(pci, card->driver)) < 0) { 2379 err = pci_request_regions(pci, card->driver); 2380 if (err < 0) { 2368 2381 kfree(chip); 2369 2382 pci_disable_device(pci); … … 2385 2398 chip->ac97_clock = ac97_clock; 2386 2399 2387 if ((err = snd_via82xx_chip_init(chip)) < 0) { 2400 err = snd_via82xx_chip_init(chip); 2401 if (err < 0) { 2388 2402 snd_via82xx_free(chip); 2389 2403 return err; 2390 2404 } 2391 2405 2392 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 2406 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 2407 if (err < 0) { 2393 2408 snd_via82xx_free(chip); 2394 2409 return err; … … 2546 2561 } 2547 2562 2548 if ((err = snd_via82xx_create(card, pci, chip_type, pci->revision, 2549 ac97_clock, &chip)) < 0) 2563 err = snd_via82xx_create(card, pci, chip_type, pci->revision, 2564 ac97_clock, &chip); 2565 if (err < 0) 2550 2566 goto __error; 2551 2567 card->private_data = chip; 2552 if ((err = snd_via82xx_mixer_new(chip, ac97_quirk)) < 0) 2568 err = snd_via82xx_mixer_new(chip, ac97_quirk); 2569 if (err < 0) 2553 2570 goto __error; 2554 2571 2555 2572 if (chip_type == TYPE_VIA686) { 2556 if ((err = snd_via686_pcm_new(chip)) < 0 || 2557 (err = snd_via686_init_misc(chip)) < 0) 2573 err = snd_via686_pcm_new(chip); 2574 if (err < 0) 2575 goto __error; 2576 err = snd_via686_init_misc(chip); 2577 if (err < 0) 2558 2578 goto __error; 2559 2579 } else { 2560 2580 if (chip_type == TYPE_VIA8233A) { 2561 if ((err = snd_via8233a_pcm_new(chip)) < 0) 2581 err = snd_via8233a_pcm_new(chip); 2582 if (err < 0) 2562 2583 goto __error; 2563 2584 // chip->dxs_fixed = 1; /* FIXME: use 48k for DXS #3? */ 2564 2585 } else { 2565 if ((err = snd_via8233_pcm_new(chip)) < 0) 2586 err = snd_via8233_pcm_new(chip); 2587 if (err < 0) 2566 2588 goto __error; 2567 2589 if (dxs_support == VIA_DXS_48K) … … 2574 2596 } 2575 2597 } 2576 if ((err = snd_via8233_init_misc(chip)) < 0) 2598 err = snd_via8233_init_misc(chip); 2599 if (err < 0) 2577 2600 goto __error; 2578 2601 } … … 2588 2611 snd_via82xx_proc_init(chip); 2589 2612 2590 if ((err = snd_card_register(card)) < 0) { 2613 err = snd_card_register(card); 2614 if (err < 0) { 2591 2615 snd_card_free(card); 2592 2616 return err; -
GPL/trunk/alsa-kernel/pci/via82xx_modem.c
r695 r703 370 370 while (timeout-- > 0) { 371 371 udelay(1); 372 if (!((val = snd_via82xx_codec_xread(chip)) & VIA_REG_AC97_BUSY)) 372 val = snd_via82xx_codec_xread(chip); 373 if (!(val & VIA_REG_AC97_BUSY)) 373 374 return val & 0xffff; 374 375 } … … 739 740 runtime->hw = snd_via82xx_hw; 740 741 741 if ((err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 742 &hw_constraints_rates)) < 0) 742 err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 743 &hw_constraints_rates); 744 if (err < 0) 743 745 return err; 744 746 745 747 /* we may remove following constaint when we modify table entries 746 748 in interrupt */ 747 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 749 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 750 if (err < 0) 748 751 return err; 749 752 … … 879 882 }; 880 883 881 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus)) < 0) 884 err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus); 885 if (err < 0) 882 886 return err; 883 887 chip->ac97_bus->private_free = snd_via82xx_mixer_free_ac97_bus; … … 891 895 ac97.num = chip->ac97_secondary; 892 896 893 if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97)) < 0) 897 err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97); 898 if (err < 0) 894 899 return err; 895 900 … … 972 977 } while (time_before(jiffies, end_time)); 973 978 974 if ((val = snd_via82xx_codec_xread(chip)) & VIA_REG_AC97_BUSY) 979 val = snd_via82xx_codec_xread(chip); 980 if (val & VIA_REG_AC97_BUSY) 975 981 dev_err(chip->card->dev, 976 982 "AC'97 codec is not ready [0x%x]\n", val); … … 984 990 (VIA_REG_AC97_CODEC_ID_SECONDARY << VIA_REG_AC97_CODEC_ID_SHIFT)); 985 991 do { 986 if ((val = snd_via82xx_codec_xread(chip)) & VIA_REG_AC97_SECONDARY_VALID) { 992 val = snd_via82xx_codec_xread(chip); 993 if (val & VIA_REG_AC97_SECONDARY_VALID) { 987 994 chip->ac97_secondary = 1; 988 995 goto __ac97_ok2; … … 1080 1087 }; 1081 1088 1082 if ((err = pci_enable_device(pci)) < 0) 1089 err = pci_enable_device(pci); 1090 if (err < 0) 1083 1091 return err; 1084 1092 1085 if ((chip = kzalloc(sizeof(*chip), GFP_KERNEL)) == NULL) { 1093 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1094 if (!chip) { 1086 1095 pci_disable_device(pci); 1087 1096 return -ENOMEM; … … 1093 1102 chip->irq = -1; 1094 1103 1095 if ((err = pci_request_regions(pci, card->driver)) < 0) { 1104 err = pci_request_regions(pci, card->driver); 1105 if (err < 0) { 1096 1106 kfree(chip); 1097 1107 pci_disable_device(pci); … … 1110 1120 chip->ac97_clock = ac97_clock; 1111 1121 1112 if ((err = snd_via82xx_chip_init(chip)) < 0) { 1122 err = snd_via82xx_chip_init(chip); 1123 if (err < 0) { 1113 1124 snd_via82xx_free(chip); 1114 1125 return err; 1115 1126 } 1116 1127 1117 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 1128 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 1129 if (err < 0) { 1118 1130 snd_via82xx_free(chip); 1119 1131 return err; … … 1155 1167 } 1156 1168 1157 if ((err = snd_via82xx_create(card, pci, chip_type, pci->revision, 1158 ac97_clock, &chip)) < 0) 1169 err = snd_via82xx_create(card, pci, chip_type, pci->revision, 1170 ac97_clock, &chip); 1171 if (err < 0) 1159 1172 goto __error; 1160 1173 card->private_data = chip; 1161 if ((err = snd_via82xx_mixer_new(chip)) < 0) 1174 err = snd_via82xx_mixer_new(chip); 1175 if (err < 0) 1162 1176 goto __error; 1163 1177 1164 if ((err = snd_via686_pcm_new(chip)) < 0 ) 1178 err = snd_via686_pcm_new(chip); 1179 if (err < 0) 1165 1180 goto __error; 1166 1181 … … 1174 1189 snd_via82xx_proc_init(chip); 1175 1190 1176 if ((err = snd_card_register(card)) < 0) { 1191 err = snd_card_register(card); 1192 if (err < 0) { 1177 1193 snd_card_free(card); 1178 1194 return err; -
GPL/trunk/alsa-kernel/pci/ymfpci/ymfpci.c
r695 r703 77 77 if (io_port == 1) { 78 78 /* auto-detect */ 79 if (!(io_port = pci_resource_start(chip->pci, 2))) 79 io_port = pci_resource_start(chip->pci, 2); 80 if (!io_port) 80 81 return -ENODEV; 81 82 } … … 86 87 if (io_port == 0x203) 87 88 continue; 88 if ((r = request_region(io_port, 1, "YMFPCI gameport")) != NULL) 89 r = request_region(io_port, 1, "YMFPCI gameport"); 90 if (r) 89 91 break; 90 92 } … … 107 109 } 108 110 109 if (!r && !(r = request_region(io_port, 1, "YMFPCI gameport"))) { 110 dev_err(chip->card->dev, 111 "joystick port %#x is in use.\n", io_port); 112 return -EBUSY; 111 if (!r) { 112 r = request_region(io_port, 1, "YMFPCI gameport"); 113 if (!r) { 114 dev_err(chip->card->dev, 115 "joystick port %#x is in use.\n", io_port); 116 return -EBUSY; 117 } 113 118 } 114 119 … … 198 203 fm_port[dev] = pci_resource_start(pci, 1); 199 204 } 200 if (fm_port[dev] > 0 && 201 (fm_res = request_region(fm_port[dev], 4, "YMFPCI OPL3")) != NULL) { 205 if (fm_port[dev] > 0) 206 fm_res = request_region(fm_port[dev], 4, "YMFPCI OPL3"); 207 if (fm_res) { 202 208 legacy_ctrl |= YMFPCI_LEGACY_FMEN; 203 209 pci_write_config_word(pci, PCIR_DSXG_FMBASE, fm_port[dev]); … … 207 213 mpu_port[dev] = pci_resource_start(pci, 1) + 0x20; 208 214 } 209 if (mpu_port[dev] > 0 && 210 (mpu_res = request_region(mpu_port[dev], 2, "YMFPCI MPU401")) != NULL) { 215 if (mpu_port[dev] > 0) 216 mpu_res = request_region(mpu_port[dev], 2, "YMFPCI MPU401"); 217 if (mpu_res) { 211 218 legacy_ctrl |= YMFPCI_LEGACY_MEN; 212 219 pci_write_config_word(pci, PCIR_DSXG_MPU401BASE, mpu_port[dev]); … … 220 227 default: fm_port[dev] = 0; break; 221 228 } 222 if (fm_port[dev] > 0 && 223 (fm_res = request_region(fm_port[dev], 4, "YMFPCI OPL3")) != NULL) { 229 if (fm_port[dev] > 0) 230 fm_res = request_region(fm_port[dev], 4, "YMFPCI OPL3"); 231 if (fm_res) { 224 232 legacy_ctrl |= YMFPCI_LEGACY_FMEN; 225 233 } else { … … 234 242 default: mpu_port[dev] = 0; break; 235 243 } 236 if (mpu_port[dev] > 0 && 237 (mpu_res = request_region(mpu_port[dev], 2, "YMFPCI MPU401")) != NULL) { 244 if (mpu_port[dev] > 0) 245 mpu_res = request_region(mpu_port[dev], 2, "YMFPCI MPU401"); 246 if (mpu_res) { 238 247 legacy_ctrl |= YMFPCI_LEGACY_MEN; 239 248 } else { … … 249 258 pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl); 250 259 pci_write_config_word(pci, PCIR_DSXG_ELEGACY, legacy_ctrl2); 251 if ((err = snd_ymfpci_create(card, pci, 252 old_legacy_ctrl, 253 &chip)) < 0) { 260 err = snd_ymfpci_create(card, pci, old_legacy_ctrl, &chip); 261 if (err < 0) { 254 262 release_and_free_resource(mpu_res); 255 263 release_and_free_resource(fm_res); … … 292 300 293 301 if (chip->mpu_res) { 294 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_YMFPCI, 295 mpu_port[dev], 296 MPU401_INFO_INTEGRATED | 297 MPU401_INFO_IRQ_HOOK, 298 -1, &chip->rawmidi)) < 0) { 302 err = snd_mpu401_uart_new(card, 0, MPU401_HW_YMFPCI, 303 mpu_port[dev], 304 MPU401_INFO_INTEGRATED | 305 MPU401_INFO_IRQ_HOOK, 306 -1, &chip->rawmidi); 307 if (err < 0) { 299 308 dev_warn(card->dev, 300 309 "cannot initialize MPU401 at 0x%lx, skipping...\n", … … 305 314 } 306 315 if (chip->fm_res) { 307 if ((err = snd_opl3_create(card, 308 fm_port[dev], 309 fm_port[dev] + 2, 310 OPL3_HW_OPL3, 1, &opl3)) < 0) { 316 err = snd_opl3_create(card, 317 fm_port[dev], 318 fm_port[dev] + 2, 319 OPL3_HW_OPL3, 1, &opl3); 320 if (err < 0) { 311 321 dev_warn(card->dev, 312 322 "cannot initialize FM OPL3 at 0x%lx, skipping...\n", … … 314 324 legacy_ctrl &= ~YMFPCI_LEGACY_FMEN; 315 325 pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl); 316 } else if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 317 dev_err(card->dev, "cannot create opl3 hwdep\n"); 318 goto free_card; 326 } else { 327 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 328 if (err < 0) { 329 dev_err(card->dev, "cannot create opl3 hwdep\n"); 330 goto free_card; 331 } 319 332 } 320 333 } -
GPL/trunk/alsa-kernel/pci/ymfpci/ymfpci_main.c
r679 r703 297 297 u32 pos, delta; 298 298 299 if ((ypcm = voice->ypcm) == NULL) 299 ypcm = voice->ypcm; 300 if (!ypcm) 300 301 return; 301 302 if (ypcm->substream == NULL) … … 633 634 int err; 634 635 635 if ((err = snd_ymfpci_pcm_voice_alloc(ypcm, params_channels(hw_params))) < 0) 636 err = snd_ymfpci_pcm_voice_alloc(ypcm, params_channels(hw_params)); 637 if (err < 0) 636 638 return err; 637 639 return 0; … … 937 939 int err; 938 940 939 if ((err = snd_ymfpci_playback_open_1(substream)) < 0) 941 err = snd_ymfpci_playback_open_1(substream); 942 if (err < 0) 940 943 return err; 941 944 ypcm = runtime->private_data; … … 959 962 int err; 960 963 961 if ((err = snd_ymfpci_playback_open_1(substream)) < 0) 964 err = snd_ymfpci_playback_open_1(substream); 965 if (err < 0) 962 966 return err; 963 967 ypcm = runtime->private_data; … … 987 991 int err; 988 992 989 if ((err = snd_ymfpci_playback_open_1(substream)) < 0) 993 err = snd_ymfpci_playback_open_1(substream); 994 if (err < 0) 990 995 return err; 991 996 ypcm = runtime->private_data; … … 1129 1134 int err; 1130 1135 1131 if ((err = snd_pcm_new(chip->card, "YMFPCI", device, 32, 1, &pcm)) < 0) 1136 err = snd_pcm_new(chip->card, "YMFPCI", device, 32, 1, &pcm); 1137 if (err < 0) 1132 1138 return err; 1133 1139 pcm->private_data = chip; … … 1162 1168 int err; 1163 1169 1164 if ((err = snd_pcm_new(chip->card, "YMFPCI - PCM2", device, 0, 1, &pcm)) < 0) 1170 err = snd_pcm_new(chip->card, "YMFPCI - PCM2", device, 0, 1, &pcm); 1171 if (err < 0) 1165 1172 return err; 1166 1173 pcm->private_data = chip; … … 1195 1202 int err; 1196 1203 1197 if ((err = snd_pcm_new(chip->card, "YMFPCI - IEC958", device, 1, 0, &pcm)) < 0) 1204 err = snd_pcm_new(chip->card, "YMFPCI - IEC958", device, 1, 0, &pcm); 1205 if (err < 0) 1198 1206 return err; 1199 1207 pcm->private_data = chip; … … 1235 1243 int err; 1236 1244 1237 if ((err = snd_pcm_new(chip->card, "YMFPCI - Rear", device, 1, 0, &pcm)) < 0) 1245 err = snd_pcm_new(chip->card, "YMFPCI - Rear", device, 1, 0, &pcm); 1246 if (err < 0) 1238 1247 return err; 1239 1248 pcm->private_data = chip; … … 1790 1799 }; 1791 1800 1792 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus)) < 0) 1801 err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus); 1802 if (err < 0) 1793 1803 return err; 1794 1804 chip->ac97_bus->private_free = snd_ymfpci_mixer_free_ac97_bus; … … 1798 1808 ac97.private_data = chip; 1799 1809 ac97.private_free = snd_ymfpci_mixer_free_ac97; 1800 if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97)) < 0) 1810 err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97); 1811 if (err < 0) 1801 1812 return err; 1802 1813 … … 1806 1817 1807 1818 for (idx = 0; idx < ARRAY_SIZE(snd_ymfpci_controls); idx++) { 1808 if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_ymfpci_controls[idx], chip))) < 0) 1819 err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_ymfpci_controls[idx], chip)); 1820 if (err < 0) 1809 1821 return err; 1810 1822 } … … 1819 1831 if (snd_BUG_ON(!chip->pcm_spdif)) 1820 1832 return -ENXIO; 1821 if ((err = snd_ctl_add(chip->card, kctl = snd_ctl_new1(&snd_ymfpci_spdif_default, chip))) < 0) 1833 kctl = snd_ctl_new1(&snd_ymfpci_spdif_default, chip); 1834 err = snd_ctl_add(chip->card, kctl); 1835 if (err < 0) 1822 1836 return err; 1823 1837 kctl->id.device = chip->pcm_spdif->device; 1824 if ((err = snd_ctl_add(chip->card, kctl = snd_ctl_new1(&snd_ymfpci_spdif_mask, chip))) < 0) 1838 kctl = snd_ctl_new1(&snd_ymfpci_spdif_mask, chip); 1839 err = snd_ctl_add(chip->card, kctl); 1840 if (err < 0) 1825 1841 return err; 1826 1842 kctl->id.device = chip->pcm_spdif->device; 1827 if ((err = snd_ctl_add(chip->card, kctl = snd_ctl_new1(&snd_ymfpci_spdif_stream, chip))) < 0) 1843 kctl = snd_ctl_new1(&snd_ymfpci_spdif_stream, chip); 1844 err = snd_ctl_add(chip->card, kctl); 1845 if (err < 0) 1828 1846 return err; 1829 1847 kctl->id.device = chip->pcm_spdif->device; … … 1831 1849 1832 1850 /* direct recording source */ 1833 if (chip->device_id == PCI_DEVICE_ID_YAMAHA_754 && 1834 (err = snd_ctl_add(chip->card, kctl = snd_ctl_new1(&snd_ymfpci_drec_source, chip))) < 0) 1835 return err; 1851 if (chip->device_id == PCI_DEVICE_ID_YAMAHA_754) { 1852 kctl = snd_ctl_new1(&snd_ymfpci_drec_source, chip); 1853 err = snd_ctl_add(chip->card, kctl); 1854 if (err < 0) 1855 return err; 1856 } 1836 1857 1837 1858 /* … … 1839 1860 */ 1840 1861 if (rear_switch) { 1841 if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_ymfpci_rear_shared, chip))) < 0) 1862 err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_ymfpci_rear_shared, chip)); 1863 if (err < 0) 1842 1864 return err; 1843 1865 } … … 1852 1874 kctl->id.subdevice = idx; 1853 1875 kctl->private_value = (unsigned long)substream; 1854 if ((err = snd_ctl_add(chip->card, kctl)) < 0) 1876 err = snd_ctl_add(chip->card, kctl); 1877 if (err < 0) 1855 1878 return err; 1856 1879 chip->pcm_mixer[idx].left = 0x8000; … … 1933 1956 tid.device = device; 1934 1957 tid.subdevice = 0; 1935 if ((err = snd_timer_new(chip->card, "YMFPCI", &tid, &timer)) >= 0) { 1958 err = snd_timer_new(chip->card, "YMFPCI", &tid, &timer); 1959 if (err >= 0) { 1936 1960 strcpy(timer->name, "YMFPCI timer"); 1937 1961 timer->private_data = chip; … … 2339 2363 2340 2364 /* enable PCI device */ 2341 if ((err = pci_enable_device(pci)) < 0) 2365 err = pci_enable_device(pci); 2366 if (err < 0) 2342 2367 return err; 2343 2368 … … 2362 2387 chip->src441_used = -1; 2363 2388 2364 if ((chip->res_reg_area = request_mem_region(chip->reg_area_phys, 0x8000, "YMFPCI")) == NULL) { 2389 chip->res_reg_area = request_mem_region(chip->reg_area_phys, 0x8000, "YMFPCI"); 2390 if (!chip->res_reg_area) { 2365 2391 dev_err(chip->card->dev, 2366 2392 "unable to grab memory region 0x%lx-0x%lx\n",
Note:
See TracChangeset
for help on using the changeset viewer.