From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.42 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796317733; b=QzShz5DrCgFmt6PAHu2cSOk9xxXRrBt9CRvquAQ9Iw/JDNt7tkvydalr7ys3RAz+dr6K lZmUjJ9RQnX2LqxLu+UMmGHw2JdnV7zJ5bKrwbLr5NFH2LEotDHQmjo5TrjlK+hkz94Dg B/nx7EO1YpEnC1jMjwIQZDdh7g9VuKpH+FtVITg3myh6IqoH1/y8CG3Ge5BTJzFF+pGGn E5+zAt7ZWNDC6sS/xfNIrG37iXTV6KNcavJkZFr0uSZG4La4cVTOwUF6ZZRRURpyNrHse UB38+4BQo2svqNXfuwGnL5mA8Ch2Qo1UuZ/MJW47ePEWj4ewJFU1KAJqVMs2b9OwoEw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796317733; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=dGMCy79H3FoJd1t2diZUyHpcwgnfTmQGaBJ6Qtun++w=; b=Wl6UdcxDv97lqKffzQ58xUTkjraTqT8VP0D4xsc2j+StyElYSojChzSMsaw9wI0x7pdr 3YEGRM3LOfG0yGuQFsPbOEtwy1J6SY/sZTYvCtDOY7hLwLVXKt9CN1qPg2Vcwc+DWyMBn IMLa3QQK747BQRPtDAhY651pXBrDKm3aydZP/IVSKK/V0zCLbXcr7VbJC99AvZDXzQGl8 FDD1m2tLR9ccUoBIJwWjykRApMYwBlecf6iv/Vgz+DdMZtJacbJ4Wmyc4+TnLdPPfGCNw ybA1YPaOmnQPXUz66S/IuwBF5G88YpNn7i6jZbqduUYtBoo9Lz9ZUluAApPDgAuWFPw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=05P06dUt; arc=none smtp.remote-ip=74.125.82.42 Received: from mail-dl1-f42.google.com (mail-dl1-f42.google.com [74.125.82.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B27F7606A322 for ; Thu, 3 Dec 2026 17:08:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B27F7606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=05P06dUt Received: by mail-dl1-f42.google.com with SMTP id a92af1059eb24-1b5bbedcdbeso5190779c88.0 for ; Thu, 03 Dec 2026 09:08:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796317732; x=1796922532; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=dGMCy79H3FoJd1t2diZUyHpcwgnfTmQGaBJ6Qtun++w=; b=05P06dUta/YvUo8h6bxL8eYn/5v7axqY/UVWY+FTLpi9GEjAtn71kEl4gIqzvKOStD jCoisR1F4m38beIcLGnvbApMVmFLHcIU5zVkNkcClCFKzrE9bDlY05EVcjGHxWH1OLM3 gxu07sjw0lifcAHO4AYGJFhTCa+m75C6MQi6XkY3uEVzT+dTl1ZAmzTFcUzzrjufHn03 AAm/HD0/4cfr9JxyzFHZgkPQc5pPxV1FjsflDxOxhkrgoyDqjc9rL/Dcldk0vtRW34y1 c7DWUvbvWlhRHXjEtWNvm1RrbDSi3lIv7+D+WoScLDLba9BQ8Oiw3vp0aXIoadCen1yZ dvmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796317732; x=1796922532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=dGMCy79H3FoJd1t2diZUyHpcwgnfTmQGaBJ6Qtun++w=; b=EYXOGryXjtIuYaQU9cAR20C8izjg6N8ySwYoNJ1RG5t1FPEdoLrvkttTX3qUI/2Bvr 7+kC6eGMJcJrB0EsvWUAxQ70rLKYPeqlTJoxo8M/0PS4RA1ziqyxrH2HmKdV3JI2udbF Roi3CTYmX2q/IR46CQAFfP7S6AButZGkXiSYwFr7i1aBmY+q91fBdvsGHfl/Ycwoi4ps 2/5qPH/43pfjkLvxbrMn6tJFKMSZqqUXt49ewLvjIdq+rxxWxm3HD0/i8DJF3rK58UHH FTmZSdCgQRKXoMdYvvPIEO0HN/AuTPWnbaIS0bIj+6ZnHOsFHtsd8yBu8ABkS96Cu5Uv LiRA== X-Forwarded-Encrypted: i=1; AL+hErEKG9BOcLoi1FSeZgHLMqSbAnwceCmbsfpk8J4bXVriaN9DlHIyrtsub3hqzt1GpcwFmGVfCwpdvBhRl38=@vger.kernel.org X-Gm-Message-State: APuU4Z+I/xRgpyMvo+JeljXh0ZCbxIQVyRNdm2YdDHe6WEec5AH7vJPy 9wcjwjnOMuEQzBh5POfYu4dKCW+Vldg43NMWhOGDBrgKfW8LEcTsPCkliicZGQ== X-Gm-Gg: AZFdTZf4cwOGICCxrfipO+A5jrCJa+RfD7TeZajsqwnDo/CytGA0JRCXMxrhd6Esquo R8jnCm4forRMOmyTjw/XVNjGU0PxXXIl7baK/Lyv/MLFMe7WqPpYkMbROGQTWRpBp6pNPpOI0+a u8rLP3iYajc18dW3fxgo9WsR+/HeXqwCyeUwGp8gGlrrDNbFLi3qrIP3OO5ZI2GcnLzTlOObbbd SxJJzDmILOAJyCGV3kVNTuP2++G8TmpIXsYnQzbOrKxs7FAypcct4cCVvPH9FNIM6i99VNygPRD 4gPfXH6MYI+AqN4f6RJusow6rrcoJcJ3Mp5/qtsVj806Voo2C8jyF+5rxnWE43OqnJjkPJoMxYP 21RgcLIgQLjxFByzTnhwFxgfDb8ntu57A5JbkUfu5ieU6kyBEw0ocyvA5EPVffozj9GTk24TMCW py/MyCsVP34l1M97pnuQ5NeRzFgAjNSKzUkU1D0rHnq8ba0g1o6KZDmhw80pna0yvZ/u3ygya9B zAeg/yupkFLy+MElfaqX0HmcV1X2oKyG0jnAdZvQw/PqfyfeL2dlfT+r+nvTjBYPbBQGkIExABV OgQkTti7ObrxCFneIsUxYKmhihMcGZdJy5GUZzFJRSCAXLMgjn3f X-Received: by 2002:a05:701a:c9ce:20b0:1b5:d170:5b2a with SMTP id a92af1059eb24-1b5d170790dmr1411642c88.39.1796317731816; Thu, 03 Dec 2026 09:08:51 -0800 (PST) Received: from localhost.localdomain ([103.149.158.169]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5567ff27bsm123486453c88.6.2026.12.03.09.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 09:08:51 -0800 (PST) From: Sreeraj S Kurup To: perex@perex.cz, tiwai@suse.de, lgirdwood@gmail.com, broonie@kernel.org Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Sreeraj S Kurup Subject: [PATCH 2/3] ALSA: hda: hdmi_chmap: Update HDMI channel map codec read callers Date: Thu, 3 Dec 2026 17:05:01 +0000 Message-ID: <20261203170741.3873-3-sreekuttan2156239@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261203170741.3873-1-sreekuttan2156239@gmail.com> References: <20261203170741.3873-1-sreekuttan2156239@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Update callers of snd_hdac_codec_read() in hdmi_chmap.c to use the new status and output parameter interface. Check the return status before using the codec response, and propagate read errors from the channel mapping helper functions. Also avoid updating the converter channel count when reading the current channel count fails. Signed-off-by: Sreeraj S Kurup --- sound/hda/core/hdmi_chmap.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/sound/hda/core/hdmi_chmap.c b/sound/hda/core/hdmi_chmap.c index c897fc443467..e9e599154ef1 100644 --- a/sound/hda/core/hdmi_chmap.c +++ b/sound/hda/core/hdmi_chmap.c @@ -190,21 +190,41 @@ static int hdmi_pin_set_slot_channel(struct hdac_device *codec, static int hdmi_pin_get_slot_channel(struct hdac_device *codec, hda_nid_t pin_nid, int asp_slot) { - return (snd_hdac_codec_read(codec, pin_nid, 0, + unsigned int res; + int err; + + err = snd_hdac_codec_read(codec, pin_nid, 0, AC_VERB_GET_HDMI_CHAN_SLOT, - asp_slot) & 0xf0) >> 4; + asp_slot, &res); + if (err < 0) + return err; + + return (res & 0xf0) >> 4; } static int hdmi_get_channel_count(struct hdac_device *codec, hda_nid_t cvt_nid) { - return 1 + snd_hdac_codec_read(codec, cvt_nid, 0, - AC_VERB_GET_CVT_CHAN_COUNT, 0); + unsigned int res; + int err; + + err = snd_hdac_codec_read(codec, cvt_nid, 0, + AC_VERB_GET_CVT_CHAN_COUNT, 0, &res); + if (err < 0) + return err; + + return 1 + res; } static void hdmi_set_channel_count(struct hdac_device *codec, hda_nid_t cvt_nid, int chs) { - if (chs != hdmi_get_channel_count(codec, cvt_nid)) + int current; + + current = hdmi_get_channel_count(codec, cvt_nid); + if (current < 0) + return; + + if (chs != current) snd_hdac_codec_write(codec, cvt_nid, 0, AC_VERB_SET_CVT_CHAN_COUNT, chs - 1); } -- 2.55.0