From nobody Mon Sep 29 20:18:40 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 90A75C00140 for ; Tue, 16 Aug 2022 00:53:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239180AbiHPAxn (ORCPT ); Mon, 15 Aug 2022 20:53:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347593AbiHPAp7 (ORCPT ); Mon, 15 Aug 2022 20:45:59 -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 0926FADCC4; Mon, 15 Aug 2022 13:41:52 -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 9C9DA611FA; Mon, 15 Aug 2022 20:41:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F481C433C1; Mon, 15 Aug 2022 20:41:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596111; bh=5UhoXcEIbPk8Dp4swVKTZKdyP4ZLu19tMH5KXU4pwBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gm+WxyFou2i7m7pxvfJtQzmu9gv/6wTyRk/CUUMAEPbQmKSNWr8aW6KqpXHNlBBsG V3O3IGJQf0ETxDZ8SV4LBmhG0Krdb91BOw33CZ7IZupbLXltgcoiF4S81VrBekYU4q LsREale882QC4Hqe3ZCG/3bHiMdeFsxyYFeT/oUY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kuninori Morimoto , Mark Brown , Sasha Levin Subject: [PATCH 5.19 0941/1157] ASoC: audio-graph-card2.c: use of_property_read_u32() for rate Date: Mon, 15 Aug 2022 20:04:57 +0200 Message-Id: <20220815180517.175223922@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-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Kuninori Morimoto [ Upstream commit 817a62108dfacebd548e38451bf0e7eee023e97f ] Audio Graph Card2 is using of_get_property(), but it should use of_property_read_u32() to getting rate. Otherwise the setting will be strange value. This patch fixup it. Fixes: c3a15c92a67b701 ("ASoC: audio-graph-card2: add Codec2Codec support") Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87h741s961.wl-kuninori.morimoto.gx@renesas.= com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/generic/audio-graph-card2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audi= o-graph-card2.c index d34b29a49268..8e0628e6f2a0 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -856,7 +856,7 @@ int audio_graph2_link_c2c(struct asoc_simple_priv *priv, struct device_node *port0, *port1, *ports; struct device_node *codec0_port, *codec1_port; struct device_node *ep0, *ep1; - u32 val; + u32 val =3D 0; int ret =3D -EINVAL; =20 /* @@ -880,7 +880,8 @@ int audio_graph2_link_c2c(struct asoc_simple_priv *priv, ports =3D of_get_parent(port0); port1 =3D of_get_next_child(ports, lnk); =20 - if (!of_get_property(ports, "rate", &val)) { + of_property_read_u32(ports, "rate", &val); + if (!val) { struct device *dev =3D simple_priv_to_dev(priv); =20 dev_err(dev, "Codec2Codec needs rate settings\n"); --=20 2.35.1