Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1886671pxp; Thu, 17 Mar 2022 20:25:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaAmPZrIoBVX9KrBvFOQhmkF4MWz+LeHujkzZFgAxTJHotkLithOWei+jIYU4jx3j9KGn7 X-Received: by 2002:a17:90a:de11:b0:1c6:b266:d15f with SMTP id m17-20020a17090ade1100b001c6b266d15fmr627809pjv.150.1647573959159; Thu, 17 Mar 2022 20:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647573959; cv=none; d=google.com; s=arc-20160816; b=bqFNIOcHR7GO9kNvIHW2kdEhtJ9X9luDi8nr3vFv+Lzm4s4oe2W2+Yubec/VnCfEx7 ZtXoyu4sNnq05lu23hUHsNym7/8n0/sS+AKADc6Z/r2FtohB7Bm4lohvBp4mNtfKxQfR BozE3mAbwDw1SZ+RsF41l7wdhP6WQHiPSIbccSUa2HzS2m/YAM9p+BQdqg0WdjRKSY9Y HzdEOEn7npJb5NySQvmabmQjOyc6yVaYr88Qrdyo3ZC7dxxnepcxyoTcZ02X6NlkOoPR iJhFYkjnizs4OJ4Q9inYEUmobnpfVKtW9P+BNWQAMpnqj0XMPmHKArDcbOBbukLZN1kj C6XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=PlRuZuCq7DUoO4mOnORbTFdEhWT6qbVEI7bA08tCyiE=; b=J2unngyzShMvcmf8kA3XzwBqCajiLUf8Jw84KTbfRU+vmv2wjeOfdszoEN5Uvnl/tt c+78RR9RJA4vh4SUGBh8ha6g4jyxAIaYSwO+jCICePwuY/ofRD/6sd9O9yVzxK9mGekP 12yNXiUOzPURB0r4XpnXJDKtGOyI74pwtYRzU6KEfA7DVfDfgs8HDMBzQg47D5Z309BG hnuDFYM1k+quY0hfa6LW1v/wvgYoN6RA8OR3rvs4H2hqV/VP+toAqaQyWwIj+0gIzGnx 2Xo/LrZK6nB9bgTbiELr6mqp/jlDgqS8tQMtHSKzw2P/yYy5SJFzRW5IlWB0yW6u0BP4 6C4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 j15-20020a056a00174f00b004f3fe0661casi6868198pfc.126.2022.03.17.20.25.48; Thu, 17 Mar 2022 20:25:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231342AbiCRCzw (ORCPT + 70 others); 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 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign8 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-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); -- 2.20.1