Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp836661rdb; Sat, 7 Oct 2023 00:58:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtMgri4jyIURdILewlYPy+fL/QvH44brgQr1JnJ1LTfBr32lcSwFkCiCwC4SUM2/8gSFYj X-Received: by 2002:a05:6808:3d8:b0:3a1:e17a:b3fb with SMTP id o24-20020a05680803d800b003a1e17ab3fbmr10107700oie.1.1696665515340; Sat, 07 Oct 2023 00:58:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696665515; cv=none; d=google.com; s=arc-20160816; b=awYALCUgioi1SdoCDsdLql0Q0GtbqVpQSX+CPZVuijKFAEIWN7eA+UjIf+Bcp9/7BZ 3JLQsX1CTA3kCFUWKOMhouunjGh3Th63FLukE/HypLZp7HMHgd3awm/39SJcFPDkjb7+ CkPdI5TuLC6cgSt6slzoM71hrYNuFdrFkL+QOFh1aTHWat7dzne2bT9zGMoXoifEeShG I4uA8o0JIz4gpaGZ1k3TDAamGp6H2Bed20daEHRvqX/Sql3Gdg3E6AGCW5nfhaM2I3M0 VFYagIUy1e26dmsqZmsHl3YZ5OXiXGLqrGxLyn3pzuROTwaPhsuw8Vl9QS413mlGX4LD 9AMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3KII1ZaIMo62TrY0kD0XFXlXP/lrAGmmaUyayJoMaqk=; fh=7m8Va4sfavqxDMVZKImL+Wsoboaw2zpdu1Mlid9QZrA=; b=CN5hdq96/XznjZOZrO+XckslwLP6j10ZUzUsyyT5xyvpv/neeYxA7hXvlk66vpTGrR 1ucNnn7fuC1Rrei3l6EgBML3j9D8I4z0HU8C7P1POwJ9TBLT6y4uIWbxHtjXnGRyCpzT rWemARFW+J0oG8UTCuEIYSEF50g39PHhZMDs3jdknLJD6ldB0lcEA8eOOYPnMOf2zwwc iZUGXQcIblwVJhIdHD1Yim3VyGrdzVhgyXrSoiKWSSvY7HOd7uqPbhNwIMKUnis3UREo s5/Wx2w8LsAmWAKpBZ9mqaAN92o87Yg2Ij+/25iXGMSn2bhYB8TIm5EqTbaeQshzBMt7 HuWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="c/McKJYj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id f29-20020a63555d000000b0057404ce2fc8si5178274pgm.529.2023.10.07.00.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 00:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="c/McKJYj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id C34098037974; Sat, 7 Oct 2023 00:58:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343601AbjJGH60 (ORCPT + 99 others); Sat, 7 Oct 2023 03:58:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343737AbjJGH6Z (ORCPT ); Sat, 7 Oct 2023 03:58:25 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21248C5; Sat, 7 Oct 2023 00:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696665504; x=1728201504; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=CbjHvxyXudfS+jzLFMB4pf2hIr3LIVRFnB5F1KEY7V8=; b=c/McKJYj9dqjBP4/ItBIyHjLtUKYL6O8U+1FwzhdLaJJeNe4kibUmaBz 6RD2bhLKbQvLzi08inBhaIl4gdbXPKjlgPU5VQ3kqu1OoAebVZHXr0/bh 7+2s8l5l5htn0Jd5QpLu/tDSVjnQyE7e5nJs4dDq8/kf9otZisehpoXV8 wHQsf8eBSLmuEUJEJPUuP7p7Tr/WTHgupgrFmZb7+LW8C5Gs3DZ55J26Z m6di6+obfHdfCDdzFR0oFEqLl3bakDWUD/Oo4V1kEPRz9BzMgBtbqzQ1U SzdK7uCt8UYFI3yIyF9ABqNzaJJLVLN+6/xOQ7EFbhEjQFkcz8npaXZY/ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="374239922" X-IronPort-AV: E=Sophos;i="6.03,205,1694761200"; d="scan'208";a="374239922" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2023 00:58:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="926217413" X-IronPort-AV: E=Sophos;i="6.03,205,1694761200"; d="scan'208";a="926217413" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by orsmga005.jf.intel.com with ESMTP; 07 Oct 2023 00:58:21 -0700 Date: Sat, 7 Oct 2023 15:57:31 +0800 From: Xu Yilun To: Rob Herring Cc: Moritz Fischer , Wu Hao , Xu Yilun , Tom Rix , Michal Simek , linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] fpga: Use device_get_match_data() Message-ID: References: <20231006224633.445035-1-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231006224633.445035-1-robh@kernel.org> X-Spam-Status: No, score=2.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Sat, 07 Oct 2023 00:58:32 -0700 (PDT) X-Spam-Level: ** On Fri, Oct 06, 2023 at 05:46:33PM -0500, Rob Herring wrote: > 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 Applied. > --- > 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 >