Changeset 703 for GPL/trunk/alsa-kernel/pci/cs46xx
- Timestamp:
- Sep 26, 2021, 6:18:40 PM (4 years ago)
- Location:
- GPL/trunk
- Files:
-
- 4 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/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);
Note:
See TracChangeset
for help on using the changeset viewer.