Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp537806pxb; Mon, 16 Aug 2021 11:06:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxTOBToBrd4AyoYScnxksycTPygCB9IhcIH9jLdnLTT96lyU1qan0Ra8YJ9WUi14wRF7Ql X-Received: by 2002:a17:906:369a:: with SMTP id a26mr17211908ejc.539.1629137206997; Mon, 16 Aug 2021 11:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629137206; cv=none; d=google.com; s=arc-20160816; b=yC/tyQTZ69DOSks3tWctvOjgQD9g8O+jk5jUEZBicxkRWGK2W+36ABIpcQf/bHp6nZ q9iKc69g3kZN/lfPGT05xv5QvYY3We7cjVnF5eemGzhCTsi8xvetChOzkVH/d75EDmtD 7d1QvUFcFjW1c+FfJlUD007ejAn8Wg1K+JAbdwIoRliJI0139UouQrC2EMuQj697VmQs ZmWSwHi+W51hTO7Pg+8CVDos5hTRmZOc/BcjwQmvN4iUjF79qzvCmk1fx525sps/iQKf s4x3TapyzHHvTpFXVIKEc4HI2Hdh+W5TlAJiSeVA+COc7Pt+KnyROjiXdVaNoBQ4pGm/ I1Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=0Bb7oCof6JP2AdVaeQHQq1q4JtXbkVTdb7t98cs4z2Y=; b=SezXS8nZ9PmiS5TGchG4fccZTY/xjMIedQLq5mCM6g4Y9zcvUIAd33K7m+AXysWkUn UY5HMZWuyOGkJBovr7wZOcCDan5i3NVl+ikK0fvmXgpKuE1/BNHBLeC6qEDfcunKm8u6 szN5PmqInQjPupB4TcC/y1LqgiUhUp1YrnM9Giffbv8grdZVfKe6tTJbNS0xye4uZmlQ SF56Ccx2ZC/OC4352GBFXZAIT7maop68XyXejU3b1B1Mdr2mVT4HqHXg5sTG3qhgpnne fpZd96mlywSJVYbUZbuGvIV+C211+07horZF+qgrCGZ2I4Rdb4i0gWiVrN5FFJq9mfIW Q9pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YozBxOdS; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s7si12983580ejd.28.2021.08.16.11.06.23; Mon, 16 Aug 2021 11:06:46 -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=@kernel.org header.s=k20201202 header.b=YozBxOdS; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232183AbhHPSCq (ORCPT + 99 others); Mon, 16 Aug 2021 14:02:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:39158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229710AbhHPSCp (ORCPT ); Mon, 16 Aug 2021 14:02:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BFC3160462; Mon, 16 Aug 2021 18:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629136934; bh=B2jyaNj79A42m28exuRget68ed7+1u8WgVhr2RwnPkY=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=YozBxOdSA4wdQxQTcgrxfYHbJVGLAIgbuqAJW5BL25XSn5gcEXpkSTERuIKdJIv4w EdRxQ2e59ucRTjQqaY05rKXCb1t18D9/dTpg5TNNisvhs5ci9Q39hi4FhuFMdt/kR8 CwLhCdaKRIZdkPC2oHPJ4lOzHT/NhIvtNXkOsHtFpoNHl+f5rCrOuHq8qW1v1Gc3QI yIAz8+EVKnuRXWeAdwNkjg/8+6kjeKdfD9O4+qBtkCZ5zFbXwOwFAnuUYB+Wae9y5l BV4B2Sw7PwvrkzsLSQYgHQAdAqplCWFHIJHPz6mwnl5mf+uhNYXv5AdjJ9QyCsF0NQ KQ7QQmXDLhfSw== Date: Mon, 16 Aug 2021 13:02:12 -0500 From: Bjorn Helgaas To: Aakash Hemadri Cc: Mark Brown , Liam Girdwood , Takashi Iwai , Jawoslav Kysela , Thierry Reding , 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 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data Message-ID: <20210816180212.GA2933142@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 15, 2021 at 01:42:18AM +0530, Aakash Hemadri wrote: > Prefer `of_device_get_match_data` over `of_match_device` > > Retrieve OF match data using `of_device_get_match_data`, this is cleaner > and better expresses intent. > > Signed-off-by: Aakash Hemadri > --- > sound/soc/tegra/tegra30_ahub.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c > index b3e1df693381..0ac109b32329 100644 > --- a/sound/soc/tegra/tegra30_ahub.c > +++ b/sound/soc/tegra/tegra30_ahub.c > @@ -518,7 +518,7 @@ static int tegra30_ahub_probe(struct platform_device *pdev) > void __iomem *regs_apbif, *regs_ahub; > int ret = 0; > > - match = of_match_device(tegra30_ahub_of_match, &pdev->dev); > + match = of_device_get_match_data(&pdev->dev); I think this is incorrect. const struct of_device_id *of_match_device(...) const void *of_device_get_match_data(...) of_match_device() returns "struct of_device_id *", i.e., "match". of_device_get_match_data() calls of_match_device() internally, then returns "match->data". > if (!match) > return -EINVAL; > soc_data = match->data; > -- > 2.32.0 >