From nobody Fri Jan 2 22:37:20 2026 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 2F907E94139 for ; Fri, 6 Oct 2023 22:46:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233839AbjJFWqn (ORCPT ); Fri, 6 Oct 2023 18:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233835AbjJFWql (ORCPT ); Fri, 6 Oct 2023 18:46:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 201E1FF; Fri, 6 Oct 2023 15:46:39 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1872C433C7; Fri, 6 Oct 2023 22:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696632398; bh=6B0cZHMB1exiAQqLY9icWVKtCsobM8n83RegPN7tJS0=; h=From:To:Cc:Subject:Date:From; b=FQFvh+XaByAhOzqc8MS8PydtwxcGlF7exql8HYT9JrpgZh+e0DFwoFHmota1Vu3Z0 NC6E9g0qBXKR+t6qTJRW77IGasRu8VTkBoJSex+BSPcycJnUY8ebz0t2A2mLDgGzFM 5KdIgtc+eDCeR7pSS7SaHyVeXdFOsp3l12mUwRxKHHvoySGHGF21PlKteqhy/2PHGm XwVOnjeKviJ6tSdYPh5sq7OrZDPydwDZID2n2gjOX9mvRwH2moB/z4jWmCks1kbwre NuUN4vX5bjauFFjQ8BdlftPIXJIU5CO8s7XgOcpiI6No8W0BPnYIrcuUdj77xZydcX KzGQO1mDcnmqg== Received: (nullmailer pid 445128 invoked by uid 1000); Fri, 06 Oct 2023 22:46:36 -0000 From: Rob Herring To: Moritz Fischer , Wu Hao , Xu Yilun , Tom Rix , Michal Simek Cc: linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] fpga: Use device_get_match_data() Date: Fri, 6 Oct 2023 17:46:33 -0500 Message-Id: <20231006224633.445035-1-robh@kernel.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Acked-by: Xu Yilun --- drivers/fpga/altera-hps2fpga.c | 12 +++--------- drivers/fpga/xilinx-pr-decoupler.c | 15 ++++----------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/fpga/altera-hps2fpga.c b/drivers/fpga/altera-hps2fpga.c index aa758426c22b..578663503297 100644 --- a/drivers/fpga/altera-hps2fpga.c +++ b/drivers/fpga/altera-hps2fpga.c @@ -24,7 +24,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -127,18 +128,11 @@ static int alt_fpga_bridge_probe(struct platform_devi= ce *pdev) { struct device *dev =3D &pdev->dev; struct altera_hps2fpga_data *priv; - const struct of_device_id *of_id; struct fpga_bridge *br; u32 enable; int ret; =20 - of_id =3D of_match_device(altera_fpga_of_match, dev); - if (!of_id) { - dev_err(dev, "failed to match device\n"); - return -ENODEV; - } - - priv =3D (struct altera_hps2fpga_data *)of_id->data; + priv =3D (struct altera_hps2fpga_data *)device_get_match_data(dev); =20 priv->bridge_reset =3D of_reset_control_get_exclusive_by_index(dev->of_no= de, 0); diff --git a/drivers/fpga/xilinx-pr-decoupler.c b/drivers/fpga/xilinx-pr-de= coupler.c index 208d9560f56d..0c012d0f616d 100644 --- a/drivers/fpga/xilinx-pr-decoupler.c +++ b/drivers/fpga/xilinx-pr-decoupler.c @@ -10,8 +10,10 @@ #include #include #include -#include #include +#include +#include +#include #include =20 #define CTRL_CMD_DECOUPLE BIT(0) @@ -81,7 +83,6 @@ static const struct fpga_bridge_ops xlnx_pr_decoupler_br_= ops =3D { .enable_show =3D xlnx_pr_decoupler_enable_show, }; =20 -#ifdef CONFIG_OF static const struct xlnx_config_data decoupler_config =3D { .name =3D "Xilinx PR Decoupler", }; @@ -100,11 +101,9 @@ static const struct of_device_id xlnx_pr_decoupler_of_= match[] =3D { {}, }; MODULE_DEVICE_TABLE(of, xlnx_pr_decoupler_of_match); -#endif =20 static int xlnx_pr_decoupler_probe(struct platform_device *pdev) { - struct device_node *np =3D pdev->dev.of_node; struct xlnx_pr_decoupler_data *priv; struct fpga_bridge *br; int err; @@ -113,13 +112,7 @@ static int xlnx_pr_decoupler_probe(struct platform_dev= ice *pdev) if (!priv) return -ENOMEM; =20 - if (np) { - const struct of_device_id *match; - - match =3D of_match_node(xlnx_pr_decoupler_of_match, np); - if (match && match->data) - priv->ipconfig =3D match->data; - } + priv->ipconfig =3D device_get_match_data(&pdev->dev); =20 priv->io_base =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->io_base)) --=20 2.40.1