Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1528766iob; Thu, 19 May 2022 08:28:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiI/DDvnvkBPdGG52dTTi8ZJegguCIY7TJdq8++AV0+o1mVFM/omb+MRLFsgTH7bJJip+9 X-Received: by 2002:a17:907:62a1:b0:6da:7952:d4d2 with SMTP id nd33-20020a17090762a100b006da7952d4d2mr4846459ejc.260.1652974093990; Thu, 19 May 2022 08:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652974093; cv=none; d=google.com; s=arc-20160816; b=K1hm5axg1ogWpir56n2wu4UgVx2SOnwXFEqmmb0rqT442FiFIUc3+zzD4U1+Fuk49e tC+cv2pDDV1vDd3kPPbilRgWU7fcnX+/jpiWx1E2Mnhp0pywx4X7zViOxAc1ZE5MTWLI L8ksnwKYliwc9cMDZjaZ6+VmecFd9vzbDnggYm22p5teuMCzZMu7DniXAqoEclv1HZXR FNhmrSgQRsS7GC9R+akqwLjHxgPuYKB15ag/2ct+VDaBL9Bu0oV7bYFbE6XPttsPfhw2 qadFqyhxkIwuYqUYkfici+aiT65xQIr/aJLQUFfuWwuupg8fpSq2FtlMCN8+9VnTAL94 RhOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=RjBBO3o0exHofPw1F9i63vUIMZ6Sv9QK/0noXXFsnD4=; b=kC+wxX58oCQBF6KgarIdBCEiKAfRxT8A+dDVGRmp4Mm3H2jiQS3VMajlroWeS2oAq4 vqfUs+w3BBjEVwRD5gL/cdw9b/m9rPuyZiawd/Cu/Pw+K5jzZ48wE3RRUe2Vm0N5976K 1saIeIhO4QoMQ8/E/6dbtJkXRIOjaF2+zPmMUTtk3f/ZMowYBgX+L+5sU4RoDQoL61CH r2MXyCquurrt/dXFwa9jx+SxtC/inTrLZbuFYXWJP2W9t8Nn1OjKg/cZbethyFTi5yPh 95o6pkx+v2SK78glhqiKXRJEbv0vA7J00tMVwQ/a9s6ISg86N5+uMnKM+U/8AFyA3Gtw 3f+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a17090658d100b006fe78e68a67si5783351ejs.806.2022.05.19.08.27.44; Thu, 19 May 2022 08:28:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237973AbiESMlw (ORCPT + 99 others); Thu, 19 May 2022 08:41:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236881AbiESMlt (ORCPT ); Thu, 19 May 2022 08:41:49 -0400 Received: from cmccmta3.chinamobile.com (cmccmta3.chinamobile.com [221.176.66.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7DEBEA777A for ; Thu, 19 May 2022 05:41:45 -0700 (PDT) X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from spf.mail.chinamobile.com (unknown[172.16.121.1]) by rmmx-syy-dmz-app10-12010 (RichMail) with SMTP id 2eea62863b06e15-a810c; Thu, 19 May 2022 20:41:43 +0800 (CST) X-RM-TRANSID: 2eea62863b06e15-a810c X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.108.79.99]) by rmsmtp-syy-appsvr01-12001 (RichMail) with SMTP id 2ee162863b03441-e1d79; Thu, 19 May 2022 20:41:43 +0800 (CST) X-RM-TRANSID: 2ee162863b03441-e1d79 From: Tang Bin To: olivier.moysan@foss.st.com, arnaud.pouliquen@foss.st.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com Cc: alsa-devel@alsa-project.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tang Bin Subject: [PATCH] ASoC: stm32: sai: Use of_device_get_match_data() to simplify code Date: Thu, 19 May 2022 20:42:35 +0800 Message-Id: <20220519124235.21100-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Retrieve of match data, it's better and cleaner to use 'of_device_get_match_data' over 'of_match_device'. Signed-off-by: Tang Bin --- sound/soc/stm/stm32_sai_sub.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c index dd636af81..d300605a2 100644 --- a/sound/soc/stm/stm32_sai_sub.c +++ b/sound/soc/stm/stm32_sai_sub.c @@ -1500,7 +1500,6 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, static int stm32_sai_sub_probe(struct platform_device *pdev) { struct stm32_sai_sub_data *sai; - const struct of_device_id *of_id; const struct snd_dmaengine_pcm_config *conf = &stm32_sai_pcm_config; int ret; @@ -1508,10 +1507,9 @@ static int stm32_sai_sub_probe(struct platform_device *pdev) if (!sai) return -ENOMEM; - of_id = of_match_device(stm32_sai_sub_ids, &pdev->dev); - if (!of_id) + sai->id = (uintptr_t)of_device_get_match_data(&pdev->dev); + if (!sai->id) return -EINVAL; - sai->id = (uintptr_t)of_id->data; sai->pdev = pdev; mutex_init(&sai->ctrl_lock); -- 2.20.1.windows.1