From patchwork Fri Mar 18 02:53:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng Tang X-Patchwork-Id: 12784826 X-Patchwork-Delegate: kvalo@adurom.com 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 75437C433F5 for ; Fri, 18 Mar 2022 02:54:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231342AbiCRCzw (ORCPT ); Thu, 17 Mar 2022 22:55:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231189AbiCRCzu (ORCPT ); Thu, 17 Mar 2022 22:55:50 -0400 Received: from smtpbgsg1.qq.com (smtpbgsg1.qq.com [54.254.200.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 387D01F977F for ; Thu, 17 Mar 2022 19:54:32 -0700 (PDT) X-QQ-mid: bizesmtp75t1647572020t6n26plq Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 18 Mar 2022 10:53:33 +0800 (CST) X-QQ-SSF: 01400000002000D0I000B00A0000000 X-QQ-FEAT: 9ftZnmyzxdiZygKhI/a9zsn2Ql3YkPwABNkaIECyxsLsHR0HX3LZxYTXcGRQN m/KV9Td9UttvaF421hJafNdN84yLyFLXh/3SwI7fhumPIHVOoHQgSiKgC6wYUJ4uBnotNI5 yFUoyEco1kDAEXwtm7AV5ryuizUoeRS1ejNF4WSIdoDVNn7uPb2ClEkj+s6SFSQ96xRNEiY gkWb4KfvTqoNIcND6cSWlOwVAazxTUxi0TnJJ3aq933vRODCyB5Y11SzXTEefnQfefI9NYJ 4P3CeX/j6o7pENkfjLH1G8vJqsf7I9ETEi0F2ql4tDe7sGBEKDp+l2ojgC7ytO/AjU2BZcW Y3rd8xrdbXQ4adIcfUgTADIuPO9iQ== X-QQ-GoodBg: 2 From: Meng Tang To: kvalo@kernel.org, davem@davemloft.net Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Meng Tang Subject: [PATCH] net: wireless: ath10k: Use of_device_get_match_data() helper Date: Fri, 18 Mar 2022 10:53:31 +0800 Message-Id: <20220318025331.23030-1-tangmeng@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign8 X-QQ-Bgrelay: 1 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Only the device data is needed, not the entire struct of_device_id. Use of_device_get_match_data() instead of of_match_device(). Signed-off-by: Meng Tang --- drivers/net/wireless/ath/ath10k/ahb.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/ahb.c b/drivers/net/wireless/ath/ath10k/ahb.c index ab8f77ae5e66..f0c615fa5614 100644 --- a/drivers/net/wireless/ath/ath10k/ahb.c +++ b/drivers/net/wireless/ath/ath10k/ahb.c @@ -728,20 +728,17 @@ static int ath10k_ahb_probe(struct platform_device *pdev) struct ath10k *ar; struct ath10k_ahb *ar_ahb; struct ath10k_pci *ar_pci; - const struct of_device_id *of_id; enum ath10k_hw_rev hw_rev; size_t size; int ret; struct ath10k_bus_params bus_params = {}; - of_id = of_match_device(ath10k_ahb_of_match, &pdev->dev); - if (!of_id) { - dev_err(&pdev->dev, "failed to find matching device tree id\n"); + hw_rev = (enum ath10k_hw_rev)of_device_get_match_data(&pdev->dev); + if (!hw_rev) { + dev_err(&pdev->dev, "OF data missing\n"); return -EINVAL; } - hw_rev = (enum ath10k_hw_rev)of_id->data; - size = sizeof(*ar_pci) + sizeof(*ar_ahb); ar = ath10k_core_create(size, &pdev->dev, ATH10K_BUS_AHB, hw_rev, &ath10k_ahb_hif_ops);