From nobody Mon Sep 29 21:09:04 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE3CFC25B0D for ; Tue, 16 Aug 2022 00:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231334AbiHPAmc (ORCPT ); Mon, 15 Aug 2022 20:42:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244311AbiHPAkG (ORCPT ); Mon, 15 Aug 2022 20:40:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB67818D59C; Mon, 15 Aug 2022 13:38:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 66D9D61185; Mon, 15 Aug 2022 20:38:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59807C433C1; Mon, 15 Aug 2022 20:38:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595926; bh=tF6X0cVbkIYmd45yS0JO877bUIEvIeiAB9OCmGl9T3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=swz5vup62/ISlbz0Ji77QJ9jphMVY/TFVMcnZtSJu5CguZq+gTOLDqrf0wy02ugoR vGIOyWy9uCWM53eO2Re+Pslp7+VNBqPRM6n467csl9UPoqC2oTra03oYvV6lS6H69l AebVtFgfp2CHql9HRjUrusjvbk+Ji7LgC0+vB7HE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kuninori Morimoto , =?UTF-8?q?Martin=20Povi=C5=A1er?= , Mark Brown , Sasha Levin Subject: [PATCH 5.19 0918/1157] ASoC: soc-core.c: fixup snd_soc_of_get_dai_link_cpus() Date: Mon, 15 Aug 2022 20:04:34 +0200 Message-Id: <20220815180516.164608792@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kuninori Morimoto [ Upstream commit 586fb2641371cf7f23a401ab1c79b17e3ec457f4 ] commit 900dedd7e47cc3f ("ASoC: Introduce snd_soc_of_get_dai_link_cpus") adds new snd_soc_of_get_dai_link_cpus(), but it is using "codec" everywhere. It is very strange, and is issue when error case. It should call cpu instead of codec in error case. This patch tidyup it. Fixes: 900dedd7e47cc3f ("ASoC: Introduce snd_soc_of_get_dai_link_cpus") Signed-off-by: Kuninori Morimoto Reviewed-by: Martin Povi=C5=A1er Link: https://lore.kernel.org/r/87zgi5p7k1.wl-kuninori.morimoto.gx@renesas.= com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-core.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 9574f86dd4de..46f0e8eb79b3 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3433,26 +3433,26 @@ int snd_soc_of_get_dai_link_cpus(struct device *dev, struct of_phandle_args args; struct snd_soc_dai_link_component *component; char *name; - int index, num_codecs, ret; + int index, num_cpus, ret; =20 - /* Count the number of CODECs */ + /* Count the number of CPUs */ name =3D "sound-dai"; - num_codecs =3D of_count_phandle_with_args(of_node, name, + num_cpus =3D of_count_phandle_with_args(of_node, name, "#sound-dai-cells"); - if (num_codecs <=3D 0) { - if (num_codecs =3D=3D -ENOENT) + if (num_cpus <=3D 0) { + if (num_cpus =3D=3D -ENOENT) dev_err(dev, "No 'sound-dai' property\n"); else dev_err(dev, "Bad phandle in 'sound-dai'\n"); - return num_codecs; + return num_cpus; } component =3D devm_kcalloc(dev, - num_codecs, sizeof(*component), + num_cpus, sizeof(*component), GFP_KERNEL); if (!component) return -ENOMEM; dai_link->cpus =3D component; - dai_link->num_cpus =3D num_codecs; + dai_link->num_cpus =3D num_cpus; =20 /* Parse the list */ for_each_link_cpus(dai_link, index, component) { @@ -3468,7 +3468,7 @@ int snd_soc_of_get_dai_link_cpus(struct device *dev, } return 0; err: - snd_soc_of_put_dai_link_codecs(dai_link); + snd_soc_of_put_dai_link_cpus(dai_link); dai_link->cpus =3D NULL; dai_link->num_cpus =3D 0; return ret; --=20 2.35.1