From: Takashi Iwai Subject: Re: ALSA: hda - Don't check capture source mixer if no ADC is available Date: Mon, 05 Jul 2010 11:31:44 +0200 Message-ID: References: <20100628100958.GH19184@bicker> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id E0B4424439 for ; Mon, 5 Jul 2010 11:31:44 +0200 (CEST) In-Reply-To: <20100628100958.GH19184@bicker> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Dan Carpenter Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 28 Jun 2010 12:09:58 +0200, Dan Carpenter wrote: > > Commit fbe618f2168 "ALSA: hda - Don't check capture source mixer if no > ADC is available" added support for when there is no ADC available and > spec->adc_nids is NULL. If spec->adc_nids is NULL, can it cause a > problem later when we call snd_hda_add_nid()? If no ADC is available, there shouldn't be spec->cap_mixer, too. So, practically the current code should be OK. (Here ADC is not only for analog but rather refers to audio-in widget) thanks, Takashi > sound/pci/hda/patch_realtek.c +2643 alc_build_controls(96) > error: we previously assumed 'spec->adc_nids' could be null. > 2635 if (spec->cap_mixer) { > 2636 const char *kname = kctl ? kctl->id.name : NULL; > 2637 for (knew = spec->cap_mixer; knew->name; knew++) { > 2638 if (kname && strcmp(knew->name, kname) == 0) > 2639 continue; > 2640 kctl = snd_hda_find_mixer_ctl(codec, knew->name); > 2641 for (i = 0; kctl && i < kctl->count; i++) { > 2642 err = snd_hda_add_nid(codec, kctl, i, > 2643 spec->adc_nids[i]); > ^^^^^^^^^^^^^^^^^ > 2644 if (err < 0) > 2645 return err; > 2646 } > 2647 } > 2648 } > > regards, > dan carpenter >