Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp677797rdb; Fri, 6 Oct 2023 15:46:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBGu5zxESIHCSUaYY7dNBa15KXPRsug1PKnc0b8y5QARharcUhcpYKNXnfnqn/XJCFFFA1 X-Received: by 2002:a17:902:eb44:b0:1c3:ed30:cdf4 with SMTP id i4-20020a170902eb4400b001c3ed30cdf4mr9127014pli.4.1696632414111; Fri, 06 Oct 2023 15:46:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696632414; cv=none; d=google.com; s=arc-20160816; b=yP0V+tQlqEXPDLbonIQtR8ku1/+n7Pe4oMDhemmQgshoVlp89pIiMrWvInBfjgcUWO dMyntTr8ZhaCe0RO8cQUBTd6eaMtW0C/JOqGRa9wC8mtdlgwEnr07abMD3Fvs9D2XRgR 9YfYTdfUsd72dz2O4n5XlffIQLhr1mHVM+EB0QKkcqjfdMB1XGnz1wZToVI5gXUKifpZ 7n4hJUEXho6Clw64wNIc51RmUFV0arKTj2PDTK7A7BCSmjQtTPkR9fZXKsfXdOAA3+zP qCAIkrKQ4jFWzzgUFjvUsUFKHh+l492ca37EZp0ozCbP6irI/c21ft4qir5F2RtGyY2t yXWA== 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:dkim-signature; bh=w1zVhn8fDb9/WQEChTCD2X9ssT1A7zXrpF/iA/ejkLQ=; fh=wTRU/ySqcfKS+mz0iLcvXfYkP6n4Ge2EESo0+ZzbnXg=; b=XzqOhsQ7pZBe+QJ2eFks24Q5vrD8ayS6Kk0HDmQONSseYvANaC6e7gXtzTo4fpfko+ cFnzsxV0+vM2GBnLQ9J2HqHsW05Z1sA97v0JbnpEw8utNiYM6iNQ5l1nCiKOnMoHqzsv eM1Hj7cXBZd30M7SiM+FnsDifNt817FQb2a/je0efiYJ1GX5Rtjp6xvV4x6qyGcysUmf 4hXL9G+V6ya/4sqLMvbe7UghofpwPxxAWgRC9wA7PfzbSc6Bpg8m5gGdD9gsL9dNqbVE 8h6kd4PilwbSAB+4j4n5WjHKJQO/stUSkGI9wlDzy8eC55BZHnGvSAL+R9x8gGyonf+g TYzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FQFvh+Xa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id s5-20020a170903200500b001c88fd958ecsi2189772pla.110.2023.10.06.15.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 15:46:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FQFvh+Xa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5CB0F8365279; Fri, 6 Oct 2023 15:46:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233854AbjJFWqm (ORCPT + 99 others); Fri, 6 Oct 2023 18:46:42 -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: 8bit X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 06 Oct 2023 15:46:51 -0700 (PDT) X-Spam-Level: ** 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 --- 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_device *pdev) { struct device *dev = &pdev->dev; struct altera_hps2fpga_data *priv; - const struct of_device_id *of_id; struct fpga_bridge *br; u32 enable; int ret; - of_id = of_match_device(altera_fpga_of_match, dev); - if (!of_id) { - dev_err(dev, "failed to match device\n"); - return -ENODEV; - } - - priv = (struct altera_hps2fpga_data *)of_id->data; + priv = (struct altera_hps2fpga_data *)device_get_match_data(dev); priv->bridge_reset = of_reset_control_get_exclusive_by_index(dev->of_node, 0); diff --git a/drivers/fpga/xilinx-pr-decoupler.c b/drivers/fpga/xilinx-pr-decoupler.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 #define CTRL_CMD_DECOUPLE BIT(0) @@ -81,7 +83,6 @@ static const struct fpga_bridge_ops xlnx_pr_decoupler_br_ops = { .enable_show = xlnx_pr_decoupler_enable_show, }; -#ifdef CONFIG_OF static const struct xlnx_config_data decoupler_config = { .name = "Xilinx PR Decoupler", }; @@ -100,11 +101,9 @@ static const struct of_device_id xlnx_pr_decoupler_of_match[] = { {}, }; MODULE_DEVICE_TABLE(of, xlnx_pr_decoupler_of_match); -#endif static int xlnx_pr_decoupler_probe(struct platform_device *pdev) { - struct device_node *np = 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_device *pdev) if (!priv) return -ENOMEM; - if (np) { - const struct of_device_id *match; - - match = of_match_node(xlnx_pr_decoupler_of_match, np); - if (match && match->data) - priv->ipconfig = match->data; - } + priv->ipconfig = device_get_match_data(&pdev->dev); priv->io_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->io_base)) -- 2.40.1