From patchwork Tue Jun 6 09:38:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 689772 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7009BC7EE24 for ; Tue, 6 Jun 2023 09:41:08 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8CBD320C; Tue, 6 Jun 2023 11:40:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8CBD320C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1686044466; bh=Au+7td32DBjYAWjuy0rGyICmm9IsqEKzsHIJaKZACAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=sIjV+mhEMPz+UW06+P7dEmzIHO7i7KZfIVElKTl8wd3bpOoLlGsRnm8yh3IMUhRV3 dOYCpYG3f3c0UvS6sPugWrDEB7VcJbRuwZvHdNPzaPTsX94u4PltHrybtDcwTnB8G/ bDcvzUayl4ltUBkABhz0zcdz33gOZ7VilxGcHv5o= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 929ADF805A8; Tue, 6 Jun 2023 11:39:16 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 40FB3F8057F; Tue, 6 Jun 2023 11:39:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 43CC8F80155; Tue, 6 Jun 2023 11:39:10 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1B813F8016C for ; Tue, 6 Jun 2023 11:38:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1B813F8016C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=Q2IWttqX; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=HJzwNIVC Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 85EAC21995; Tue, 6 Jun 2023 09:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686044339; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZOQOJoKEu2EK/2SkyC325zAecqiAaSYMSX0HOnnBSpg=; b=Q2IWttqXdkV22E4CPo2lD5RxiKC6rDqmtkmVD5lbbtmCM6F6kPa4wgbr5lQAGxu7F8dqei VDixV0TpkZtcISqcwimxPwpX+x+0HNcZyPi82bENWSrzamqdT0h5l+lpSwaB2QgL2XSm7X Sv0q0LXgxKNlM+x3M9quUrV+QfWqe5w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686044339; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZOQOJoKEu2EK/2SkyC325zAecqiAaSYMSX0HOnnBSpg=; b=HJzwNIVCg+VCk7Md0cgNW10pw9bybhalO5mZ9eDv/14oYlhetDQL0nZjH5wn/upCWHaufj 3ldDs8OZLrjofgBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5C32C13A47; Tue, 6 Jun 2023 09:38:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id COWiFbP+fmTiVwAAMHmgww (envelope-from ); Tue, 06 Jun 2023 09:38:59 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Cc: Jaroslav Kysela Subject: [PATCH 1/4] ALSA: ymfpci: Fix kctl->id initialization Date: Tue, 6 Jun 2023 11:38:52 +0200 Message-Id: <20230606093855.14685-2-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230606093855.14685-1-tiwai@suse.de> References: <20230606093855.14685-1-tiwai@suse.de> MIME-Version: 1.0 Message-ID-Hash: NBCMTLN3FBI4QVOBL5S53PGZABZFJMMC X-Message-ID-Hash: NBCMTLN3FBI4QVOBL5S53PGZABZFJMMC X-MailFrom: tiwai@suse.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: ymfpci driver replaces the kctl->id.device after assigning the kctl via snd_ctl_add(). This doesn't work any longer with the new Xarray lookup change. It has to be set before snd_ctl_add() call instead. Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups") Cc: Signed-off-by: Takashi Iwai --- sound/pci/ymfpci/ymfpci_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index 6971eec45a4d..6b8d8690b6b2 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c @@ -1822,20 +1822,20 @@ int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch) if (snd_BUG_ON(!chip->pcm_spdif)) return -ENXIO; kctl = snd_ctl_new1(&snd_ymfpci_spdif_default, chip); + kctl->id.device = chip->pcm_spdif->device; err = snd_ctl_add(chip->card, kctl); if (err < 0) return err; - kctl->id.device = chip->pcm_spdif->device; kctl = snd_ctl_new1(&snd_ymfpci_spdif_mask, chip); + kctl->id.device = chip->pcm_spdif->device; err = snd_ctl_add(chip->card, kctl); if (err < 0) return err; - kctl->id.device = chip->pcm_spdif->device; kctl = snd_ctl_new1(&snd_ymfpci_spdif_stream, chip); + kctl->id.device = chip->pcm_spdif->device; err = snd_ctl_add(chip->card, kctl); if (err < 0) return err; - kctl->id.device = chip->pcm_spdif->device; chip->spdif_pcm_ctl = kctl; /* direct recording source */ From patchwork Tue Jun 6 09:38:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 690567 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42292C7EE24 for ; Tue, 6 Jun 2023 09:40:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9CD6483B; Tue, 6 Jun 2023 11:40:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9CD6483B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1686044453; bh=2qBnKGneSawCxiyMdQ8FKer+JtmUQHczOvQBvQuk/GI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=jqCMyY5hxWy50GmqW+QrueAFUGxgbqYnB2xDuF4JvzENiw24XizwTBhZXYPKvDDwa DRk+ftQDYZWQvYV/EQ+y38Aix2Meh6dAFu0dsJ4Kkb3YXB/Cr0L08uGx9Jwi99pQQD Wx+KN4wiInhIczajcKexg7XZ1tuKpnaON9KlAACk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id BEFC5F80549; Tue, 6 Jun 2023 11:39:14 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 271F2F80564; Tue, 6 Jun 2023 11:39:14 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 44045F80290; Tue, 6 Jun 2023 11:39:09 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4008EF80199 for ; Tue, 6 Jun 2023 11:38:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4008EF80199 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=XaxaYDoJ; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=MQArsOet Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9A568219A2; Tue, 6 Jun 2023 09:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686044339; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TOU4Ilov0EX8BQOwGsC+DLcG0wyO+iKjHepWC3M9uwM=; b=XaxaYDoJiQ+paUjKZaDuoWV85qWEZsP8NtJELi0bujeL2C184hEm7eC8UL83iL1XpuZX/z uqiFFExd3tRlrFWwnE6Q0QeA33E5zGmwnPcxehl0CbWpZ3CmWuvcK2KPhyMu+SIjUniJcN cTI1su1GmQxGnPGWwqzvbtF2srWn8l4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686044339; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TOU4Ilov0EX8BQOwGsC+DLcG0wyO+iKjHepWC3M9uwM=; b=MQArsOetVlB9LL+QKQX0k1RCqmHQavbttqKb5mmOyeppSpJHSF8vY88OFifV1X/b0/eoyl BHoSIDPxYqVE+OCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7C0C613519; Tue, 6 Jun 2023 09:38:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id eCuAHbP+fmTiVwAAMHmgww (envelope-from ); Tue, 06 Jun 2023 09:38:59 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Cc: Jaroslav Kysela Subject: [PATCH 2/4] ALSA: cmipci: Fix kctl->id initialization Date: Tue, 6 Jun 2023 11:38:53 +0200 Message-Id: <20230606093855.14685-3-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230606093855.14685-1-tiwai@suse.de> References: <20230606093855.14685-1-tiwai@suse.de> MIME-Version: 1.0 Message-ID-Hash: YR5D2LIRZBZE3WBDP2OHFINRIDREMLHV X-Message-ID-Hash: YR5D2LIRZBZE3WBDP2OHFINRIDREMLHV X-MailFrom: tiwai@suse.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: cmipci driver replaces the kctl->id.device after assigning the kctl via snd_ctl_add(). This doesn't work any longer with the new Xarray lookup change. It has to be set before snd_ctl_add() call instead. Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups") Cc: Signed-off-by: Takashi Iwai --- sound/pci/cmipci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 727db6d43391..6d25c12d9ef0 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -2688,20 +2688,20 @@ static int snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_device) } if (cm->can_ac3_hw) { kctl = snd_ctl_new1(&snd_cmipci_spdif_default, cm); + kctl->id.device = pcm_spdif_device; err = snd_ctl_add(card, kctl); if (err < 0) return err; - kctl->id.device = pcm_spdif_device; kctl = snd_ctl_new1(&snd_cmipci_spdif_mask, cm); + kctl->id.device = pcm_spdif_device; err = snd_ctl_add(card, kctl); if (err < 0) return err; - kctl->id.device = pcm_spdif_device; kctl = snd_ctl_new1(&snd_cmipci_spdif_stream, cm); + kctl->id.device = pcm_spdif_device; err = snd_ctl_add(card, kctl); if (err < 0) return err; - kctl->id.device = pcm_spdif_device; } if (cm->chip_version <= 37) { sw = snd_cmipci_old_mixer_switches; From patchwork Tue Jun 6 09:38:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 689773 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88259C77B73 for ; Tue, 6 Jun 2023 09:40:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 468826C1; Tue, 6 Jun 2023 11:40:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 468826C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1686044452; bh=pxG1OyaTICfwIcf8V26O6szdcxGZ5YNGuMNOwPrdpzg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bezBMzmKQMPS6UhhBJrIxIMNHLlztGEkImYWhbpYkVZyoIdKITb2GNDs/vwdFpe3/ q+o7WHplsy3I3fmMK8I2Hbc95mXYvODntL3721HbNZFFktfWO5hSTClnQyFGM73Gww He8S9/DgCmHpmjNYh2UP+kPt6K3uXxwMD4SluSu4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E2F63F80155; Tue, 6 Jun 2023 11:39:13 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 03F8FF80553; Tue, 6 Jun 2023 11:39:13 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D29A3F80494; Tue, 6 Jun 2023 11:39:07 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4FB70F800C8 for ; Tue, 6 Jun 2023 11:38:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4FB70F800C8 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=DI9Z8ReM; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3xa+rmXB Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BDBFE1FD69; Tue, 6 Jun 2023 09:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686044339; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fZ3rE/t/oIr1Fex5iwckxZz45THSEO7XJxkZERCSF2U=; b=DI9Z8ReMUJim9/8OvAKipsJiBUWUgsDdWtStgALRjyacG+dy1sHP3MpYcFNVUeCuYqIscq FBfdGUTR4e5OHldtne6yh+Aw09J6dpx/94AFvz+gUlAKmGtMsmt3CfTRqtR4yKriShxkJK edpZbL7H2Ap7GBWwZB5E54901s8wwD4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686044339; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fZ3rE/t/oIr1Fex5iwckxZz45THSEO7XJxkZERCSF2U=; b=3xa+rmXBs5l6pYoMeckCMaxy8xnRaxVdEj+NPVa7djFaiZCOPH2pJ2+bn/bHaFPnbJJ/lx Z1exfRbEURQoT2BQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9FB3D13519; Tue, 6 Jun 2023 09:38:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IFSYJbP+fmTiVwAAMHmgww (envelope-from ); Tue, 06 Jun 2023 09:38:59 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Cc: Jaroslav Kysela Subject: [PATCH 3/4] ALSA: gus: Fix kctl->id initialization Date: Tue, 6 Jun 2023 11:38:54 +0200 Message-Id: <20230606093855.14685-4-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230606093855.14685-1-tiwai@suse.de> References: <20230606093855.14685-1-tiwai@suse.de> MIME-Version: 1.0 Message-ID-Hash: LJ7MZGYR36K6VBAPGWHDXBA5MH6FENVS X-Message-ID-Hash: LJ7MZGYR36K6VBAPGWHDXBA5MH6FENVS X-MailFrom: tiwai@suse.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: GUS driver replaces the kctl->id.index after assigning the kctl via snd_ctl_add(). This doesn't work any longer with the new Xarray lookup change. It has to be set before snd_ctl_add() call instead. Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups") Cc: Signed-off-by: Takashi Iwai --- sound/isa/gus/gus_pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index 230f65a0e4b0..388db5fb65bd 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c @@ -892,10 +892,10 @@ int snd_gf1_pcm_new(struct snd_gus_card *gus, int pcm_dev, int control_index) kctl = snd_ctl_new1(&snd_gf1_pcm_volume_control1, gus); else kctl = snd_ctl_new1(&snd_gf1_pcm_volume_control, gus); + kctl->id.index = control_index; err = snd_ctl_add(card, kctl); if (err < 0) return err; - kctl->id.index = control_index; return 0; } From patchwork Tue Jun 6 09:38:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 690566 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 89072C7EE24 for ; Tue, 6 Jun 2023 09:41:36 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6F422827; Tue, 6 Jun 2023 11:40:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6F422827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1686044494; bh=FLCejHkX+lPkMMWSMQHSE/P5ImADM2X9Wx1tORx4CrE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lGIVYd5LYrKKWT3VMM/aer8vUZ3+I2u+0XTeF0lBZ27oYufRkhU8UiwYdsfeZrZ2w 7K7MKxYZMw6eb+5/hrqPFlgcC+8lN5KMrH0frrKk+zY1ZYCd0BJ4zqNwtFHQ9Drf0z NTxxdjB7y2KJLbiTkAohT0r+aSHHKx7K2d9n0M60= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 32C88F80290; Tue, 6 Jun 2023 11:39:50 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 90775F80290; Tue, 6 Jun 2023 11:39:49 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 94EEFF80199; Tue, 6 Jun 2023 11:39:45 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 43377F80254 for ; Tue, 6 Jun 2023 11:39:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 43377F80254 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=oJ0g/LtQ; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=WR2Lus3+ Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E4EC91FD6A; Tue, 6 Jun 2023 09:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686044339; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vDtCM+7zLxqQ9M8JZksKc+T+VK9YtODPv5ipK4lNZW8=; b=oJ0g/LtQq0yfm729y4CFTzeqX6xWfy5Mk967LH6SzeTB5Nl9D3zKXjqSTbXzDCimhY+O5R 5MgXEXk4xlBMslnXvtIauFsCUnc+v3NgcJLYeJalbvpEQi7VIrglRhHXt10pkNOG8zXkIG F1zxwAopGPwrn07o5qgDNwYD3DIssLM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686044339; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vDtCM+7zLxqQ9M8JZksKc+T+VK9YtODPv5ipK4lNZW8=; b=WR2Lus3+Xbq1TRpVzV2Ax8cCv7q3HqVqtoeHmszC7Bny12EqR56RCZazNTyc0VY1ezfWWn 13++8EPEJZZpWCDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C0DC013A47; Tue, 6 Jun 2023 09:38:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WChMLrP+fmTiVwAAMHmgww (envelope-from ); Tue, 06 Jun 2023 09:38:59 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Cc: Jaroslav Kysela Subject: [PATCH 4/4] ALSA: hda: Fix kctl->id initialization Date: Tue, 6 Jun 2023 11:38:55 +0200 Message-Id: <20230606093855.14685-5-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230606093855.14685-1-tiwai@suse.de> References: <20230606093855.14685-1-tiwai@suse.de> MIME-Version: 1.0 Message-ID-Hash: ZEQZNUYOR2F4PJH54CZMFK7ZSIQ7FFRN X-Message-ID-Hash: ZEQZNUYOR2F4PJH54CZMFK7ZSIQ7FFRN X-MailFrom: tiwai@suse.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: HD-audio core code replaces the kctl->id.index of SPDIF-related controls after assigning via snd_ctl_add(). This doesn't work any longer with the new Xarray lookup change. The change of the kctl->id content has to be done via snd_ctl_rename_id() helper, instead. Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups") Cc: Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_codec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 9f79c0ac2bda..bd19f92aeeec 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -2458,10 +2458,14 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec, type == HDA_PCM_TYPE_HDMI) { /* suppose a single SPDIF device */ for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) { + struct snd_ctl_elem_id id; + kctl = find_mixer_ctl(codec, dig_mix->name, 0, 0); if (!kctl) break; - kctl->id.index = spdif_index; + id = kctl->id; + id.index = spdif_index; + snd_ctl_rename_id(codec->card, &kctl->id, &id); } bus->primary_dig_out_type = HDA_PCM_TYPE_HDMI; }