Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1230955pxb; Tue, 17 Aug 2021 06:58:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWnxgJ1eAxRZPj6K/i3AIyJQvYU/u9eMDX5AJ/xU+4c+7wTsGHbPdKpDOuJiKUZR0Jq2ET X-Received: by 2002:a02:a113:: with SMTP id f19mr3185454jag.120.1629208714012; Tue, 17 Aug 2021 06:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629208714; cv=none; d=google.com; s=arc-20160816; b=s43HgkCcD+VimPQToz6Yc7ODCb8dmzxaYx/+BXiRBzpBxFRq0g6f5n+MqNS047zLnb S285bscl/eTe6f4U5yGX8W8q9CgyNzvV3z3mecFrVg6Bh0p8mylsp3ip/4qeOLtVIw5y eMYfhmTv/cUyc/Zd4wyBDIkRrKGlLfyTe915cMNys8U+BT8Lkm7YtDXnTCCUx/QKoMDS wvETxPJhNA7QKP2zQqN3KamKo4AJ/DsI9vHbxEAOwtxBdCQ5uhOF3v/4K1YU+tTFL4Lu cDr5/AoLFDqYUuFqjank++GQaV7o7A3JEjiD/hYzlHlzc63ewmbmD4l8LN/cyrV/QEXS hevA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6xL8KKAgtKVXqiY10rauZL3Pjki57neMrGXDUAD5maQ=; b=M7QbUKdOhRq0A3dUhRFVO1rl2aQsE1hnKuBT8mBU9P6rF6tDHPiknZUc1FB6JRRoGH LW2+KAoJAtgDar/sSMnCOvaL7PPWK/pREAt7TEy3OCDJcgm24tPXtGxyi7nH7jJ1PFre qQmijYKXyPqKcRQfIyL3F0K8Fybfp42AVrbIYY1g+P2VfUI5w9itJN+0zpA4UZJS2AsC BGkt7qH0rKJQJR/dkM57Nf4ET0WkqDGIRvn16KMEVQBOzBlmJe+sZiYnlaY+0333PD7P KpneuxKDrpLbKJdcl0Dh4DgENsr+PvZwOsRdfOILJTYyHf4JH+5Fomg1oEgcxIZdIMBP Khww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HtrhppfP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a9si2830897jat.116.2021.08.17.06.58.20; Tue, 17 Aug 2021 06:58:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HtrhppfP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240009AbhHQN5n (ORCPT + 99 others); Tue, 17 Aug 2021 09:57:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239985AbhHQN5m (ORCPT ); Tue, 17 Aug 2021 09:57:42 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04F99C0613CF; Tue, 17 Aug 2021 06:57:09 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id r7so28875811wrs.0; Tue, 17 Aug 2021 06:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6xL8KKAgtKVXqiY10rauZL3Pjki57neMrGXDUAD5maQ=; b=HtrhppfPKGETXKQk7ZaqMpU8WnD19jumtezcpkJu7F1PYATEznnv9VzV2vkGJpKarF TovRf0L0/i0XMHMAjP6MENt8v/I0dDM6zCn0VAh+mgT70o2GH9bmNrL+9xZ46UmTD+CN RZYlldEZyfaknBqYg6MGwkW+WYeplMANsHFDiEvnpO35Uw/7jf8/L+xPFmDoTZZDEcf9 UFz1j+4UZAOygrkLGgYDbe046/6VZFMZb2c16C0mBa3gTPI2KxGq7KO7eawuSgqy2q+Y +dGgh6gb13YVdhg6dxUGhyer+u8aPHYL3M7oNjgVQWCl95BJ9vHk0ozWHRStypUW3+2m 6tBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6xL8KKAgtKVXqiY10rauZL3Pjki57neMrGXDUAD5maQ=; b=tzOUjiSEohxXI7i6OnC9+g8WELDF7Re2odmUi+15w1NkdWcvt5sGXtVnvpvvd+QOFI 6Y4wZ2X+R3CMGadtJfIDqCJbedoBGIOIzp25cDNPo2GPNvKbeuzkwgTAHMrZeLQ/R4Xf Nsbv2jh9gLrKrFwfguNh3BhafQRzlRmnn98yl9aZajkAInMxhIXoVIuJeRT43oTAh8Sa 9PhGRbqJnwvBWgNywnT8rl2Ajwa135FnwU2CPUzyX5jhEDZE8aQm7qeH635gPkTtuH2O 0WmY0U81jSN8+oe8S/ovFGO3yvxaI/X7+IVhvcvEXILd+BOdidCVjBz0W2eMvFhofJHK MFPw== X-Gm-Message-State: AOAM532etbCe8cjRUU2WdfHrP6zxYS45WwTCGhMbq6WOiCst7iVcaR4D RzWQZAbAELt8/anTTDhNHCs= X-Received: by 2002:a5d:6090:: with SMTP id w16mr4403007wrt.38.1629208627684; Tue, 17 Aug 2021 06:57:07 -0700 (PDT) Received: from localhost ([217.111.27.204]) by smtp.gmail.com with ESMTPSA id z15sm2525314wrp.30.2021.08.17.06.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 06:57:06 -0700 (PDT) Date: Tue, 17 Aug 2021 15:57:05 +0200 From: Thierry Reding To: Aakash Hemadri Cc: Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Jonathan Hunter , Philipp Zabel , alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan , Bjorn Helgaas Subject: Re: [PATCH 2/2] ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data Message-ID: References: <4805c7fcd35c8deada63d41cb34d40de80f85a13.1629148177.git.aakashhemadri123@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WXB9ClFJ/LNHhScs" Content-Disposition: inline In-Reply-To: <4805c7fcd35c8deada63d41cb34d40de80f85a13.1629148177.git.aakashhemadri123@gmail.com> User-Agent: Mutt/2.1.1 (e2a89abc) (2021-07-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --WXB9ClFJ/LNHhScs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 17, 2021 at 02:44:52AM +0530, Aakash Hemadri wrote: > const struct of_device_id incorrectly assigned "match->data" using > of_device_get_match_data() >=20 > Instead assign `const struct tegra30_i2s_soc_data *soc_data` with > const void *of_device_get_match_data(...) >=20 > Fixes: 356b94a32a75 ("ASoC: tegra30: i2s: Use of_device_get_match_data") >=20 > Signed-off-by: Aakash Hemadri > --- > sound/soc/tegra/tegra30_i2s.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c > index d4c5594efaf1..084a533bf4f2 100644 > --- a/sound/soc/tegra/tegra30_i2s.c > +++ b/sound/soc/tegra/tegra30_i2s.c > @@ -406,7 +406,7 @@ static const struct of_device_id tegra30_i2s_of_match= [] =3D { > static int tegra30_i2s_platform_probe(struct platform_device *pdev) > { > struct tegra30_i2s *i2s; > - const struct of_device_id *match; > + const struct tegra30_i2s_soc_data *soc_data; > u32 cif_ids[2]; > void __iomem *regs; > int ret; > @@ -418,13 +418,13 @@ static int tegra30_i2s_platform_probe(struct platfo= rm_device *pdev) > } > dev_set_drvdata(&pdev->dev, i2s); > =20 > - match =3D of_device_get_match_data(&pdev->dev); > - if (!match) { > + soc_data =3D of_device_get_match_data(&pdev->dev); > + if (!soc_data) { > dev_err(&pdev->dev, "Error: No device match found\n"); > ret =3D -ENODEV; > goto err; > } > - i2s->soc_data =3D (struct tegra30_i2s_soc_data *)match->data; > + i2s->soc_data =3D soc_data; Same comment as for the AHUB patch, although there's a bit more potential to save boilerplate here. For instance, there's really no need for the local "soc_data" variable here, so you can assign to i2s->soc_data directly and then leave out the unnecessary check as well. Thierry --WXB9ClFJ/LNHhScs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmEbwDEACgkQ3SOs138+ s6EYFg/7BlPu/5ug2oVMVdV/HsR+3h9uwCICjMgt8/psvUDjw1SU6x2Y/Ka2dHhZ 7pLHXfsX5XZ18zrgADT0dDNwJiTBTdDwGRIwdG0hibghfJUnqIsHrI+/6EDOjm0w 3HwhNpy4vwLxcV9IVR7p/w5TRvV/rAXFnrYjo9awsvcp+9OPvZXdWtfiXiiMlpa9 PQbkq/YN6WnQO4R223jvsoHKWmG2g2+Uk8ZZ0kCmsCnip4ZAJ+IDnNGxoqACSIYu VxKUNr6a1K9ul0YKpKjm9hZu+B8q5d1n8498VdAVIrqeM6zj31dmArDXX6klPVMY X0aZ7I7YutW3k2YLLWwviyTM+j9RX2pGTVJQf8EvmUMrb5YmrOy3R961c4Zl6YCU l+byT2Fto23pJvbZp9Ao/y/YpAQFjZze0zSrg/cJGCcPql3O13CA3qgEiEEsLfss g35mfxJlcKTn+uxZDl/psbV2/ATnHtKc9Iwfve4XpNd7qsBAlfyRHbURQj/wp2O9 YU/Zk44m29ytiWDNXJr8ShWmrF7IhghQvQ4bzpsDbPwaZ5x3rQR8caKeBX7gAgKA /NaV3BGzyhRYPXEVZFn1s+XFXVgm9BHZNLUJ54McTAaBPiMYMRzD1O6I7mWeErwf id6v4FxkCJxR8N8Y05b89bwndyaDxLWSp+8rkTRoOx/CGqEb1+g= =f3kI -----END PGP SIGNATURE----- --WXB9ClFJ/LNHhScs--