Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp676940rdb; Fri, 6 Oct 2023 15:44:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZDuXdwhDi3eYgrAjnoxUvC7Ma0XcnihTqiw0yoFTx619Zu+jL4aqsOGGWM3EQOUa5sbN6 X-Received: by 2002:a17:90b:4a85:b0:268:e5db:6e19 with SMTP id lp5-20020a17090b4a8500b00268e5db6e19mr9205738pjb.20.1696632265502; Fri, 06 Oct 2023 15:44:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696632265; cv=none; d=google.com; s=arc-20160816; b=CWdUKMRtbme3Nu2uVwRqbUcC7+Y6abgP9NfCPiY7Aj5ZlAS6GrybhrDCDRV3J4Qtn2 fv2mPh0yWBOrMpRNbWwm3Ac1un9MXWFyNBzvbbd4prjf7zdzE8dB12W/Yez5UQ6fm8AM hKb4PAknfxPtgr1dUbjrb+kaGB8G13bCeOJUmz/vvmNSeRT0ybHKOpPE2T6E836BCJiR 0DOV8JRBX4sy5sJR1HG8FnEiqkoFYBBUMo7nXP/wT+phaHDM3VhAQIjzArSPJkmzAoYA w1zu9ChXjFKEod5RFzriQmS+25wTYNT84Rqw4ODpgNuhly1oWRUfgBC4Pyc8Ee+s2XoK Uz7A== 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=+1Y2S/PomOz2GJcFOK8GyUkJ2mfvjYG3ljv8xw7L28c=; fh=0YwAOEEe0rbaoCPPtJ1HDh7n9PLUZpzT9Z7sMkSvz+g=; b=i5ali/9SKjXMg842M6741hjjFh6A9Atk8zu9wuAbxTMPWKgGcY1nseshIVDnND0M6L yFwn0+bLOl73SYvJ07P26LyNEmNa2nj9VicZX7e+zakD3sjlj+UzPfg9nYhOsU6RNBz+ n9y3ih51duV9z/4QhoWiLtidgas9ORC68fGGESK3xZsDTbuK7buI8nlJjElK5+tOa9kN A/H/rUqMu068XtrNmqzntXpQLqSiNDajMRbaHDhTRq9dadNWpLzFlEpwbDv2tXvMNvYX KT2yw7uL7Pce6wXpz5HK4z+mCp8duRK7iKN9kYvlIpmdkyYo7qHWKtjvo1H6OzSd3saW rUzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L1shalJm; 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 na4-20020a17090b4c0400b00263c23a5693si5096520pjb.13.2023.10.06.15.44.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 15:44:25 -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=L1shalJm; 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 91893836524F; Fri, 6 Oct 2023 15:44:22 -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 S233773AbjJFWoI (ORCPT + 99 others); Fri, 6 Oct 2023 18:44:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233726AbjJFWoH (ORCPT ); Fri, 6 Oct 2023 18:44:07 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC9C3A2 for ; Fri, 6 Oct 2023 15:44:06 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 840CEC433C8; Fri, 6 Oct 2023 22:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696632246; bh=dnirAMJtell24Xii/tGE5TPebFmYLUGZvNx2LSkG0CE=; h=From:To:Cc:Subject:Date:From; b=L1shalJmrPTSFqzG8WwKnc2FFJ5EbudW62Hyu9km14/lsK/LDkhVfPgd/iObyRi7C pcxIGgNp4xeJyeSC4SWg6Ii94FsPueKK5AStZqHXan4NuMWU3IOJFroY0kM9RpvLnL +VrYLSJskkPXsGq2HBEBvRkba9nRwWoCA5AAU3RKwhGzMTwWzWqk8UM+aruNjSO5zA hLV1orJTpKHq+IDn8DpZBSnZvb50hDG54NFnTgYMdvmkemMyk2f5bLmp42/WvZvzP8 mW+G1oeZX6yK8QTNOPOspnLBuYNvbWx8E0H816749AwlJKTveATWaWqsKKQ46YINj5 lr39oKS6BPTyw== Received: (nullmailer pid 442177 invoked by uid 1000); Fri, 06 Oct 2023 22:44:04 -0000 From: Rob Herring To: Krzysztof Kozlowski , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Florian Fainelli , Broadcom internal kernel review list Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] memory: Use device_get_match_data() Date: Fri, 6 Oct 2023 17:44:01 -0500 Message-Id: <20231006224402.442078-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:44:22 -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/memory/atmel-ebi.c | 14 +++++++------- drivers/memory/brcmstb_memc.c | 9 +++------ drivers/memory/fsl-corenet-cf.c | 11 ++--------- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c index ec6100bc94c5..e8bb5f37f5cb 100644 --- a/drivers/memory/atmel-ebi.c +++ b/drivers/memory/atmel-ebi.c @@ -12,7 +12,10 @@ #include #include #include -#include +#include +#include +#include +#include #include #include @@ -515,16 +518,11 @@ static int atmel_ebi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *child, *np = dev->of_node, *smc_np; - const struct of_device_id *match; struct atmel_ebi *ebi; int ret, reg_cells; struct clk *clk; u32 val; - match = of_match_device(atmel_ebi_id_table, dev); - if (!match || !match->data) - return -EINVAL; - ebi = devm_kzalloc(dev, sizeof(*ebi), GFP_KERNEL); if (!ebi) return -ENOMEM; @@ -532,7 +530,9 @@ static int atmel_ebi_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ebi); INIT_LIST_HEAD(&ebi->devs); - ebi->caps = match->data; + ebi->caps = device_get_match_data(dev); + if (!ebi->caps) + return -EINVAL; ebi->dev = dev; clk = devm_clk_get(dev, NULL); diff --git a/drivers/memory/brcmstb_memc.c b/drivers/memory/brcmstb_memc.c index 233a53f5bce1..a6ea51996522 100644 --- a/drivers/memory/brcmstb_memc.c +++ b/drivers/memory/brcmstb_memc.c @@ -8,8 +8,9 @@ #include #include #include -#include +#include #include +#include #define REG_MEMC_CNTRLR_CONFIG 0x00 #define CNTRLR_CONFIG_LPDDR4_SHIFT 5 @@ -121,12 +122,9 @@ static struct attribute_group dev_attr_group = { .attrs = dev_attrs, }; -static const struct of_device_id brcmstb_memc_of_match[]; - static int brcmstb_memc_probe(struct platform_device *pdev) { const struct brcmstb_memc_data *memc_data; - const struct of_device_id *of_id; struct device *dev = &pdev->dev; struct brcmstb_memc *memc; int ret; @@ -137,8 +135,7 @@ static int brcmstb_memc_probe(struct platform_device *pdev) dev_set_drvdata(dev, memc); - of_id = of_match_device(brcmstb_memc_of_match, dev); - memc_data = of_id->data; + memc_data = device_get_match_data(dev); memc->srpd_offset = memc_data->srpd_offset; memc->ddr_ctrl = devm_platform_ioremap_resource(pdev, 0); diff --git a/drivers/memory/fsl-corenet-cf.c b/drivers/memory/fsl-corenet-cf.c index 7fc9f57ae278..8096c4f33303 100644 --- a/drivers/memory/fsl-corenet-cf.c +++ b/drivers/memory/fsl-corenet-cf.c @@ -10,10 +10,8 @@ #include #include #include -#include -#include -#include #include +#include enum ccf_version { CCF1, @@ -172,14 +170,9 @@ static irqreturn_t ccf_irq(int irq, void *dev_id) static int ccf_probe(struct platform_device *pdev) { struct ccf_private *ccf; - const struct of_device_id *match; u32 errinten; int ret, irq; - match = of_match_device(ccf_matches, &pdev->dev); - if (WARN_ON(!match)) - return -ENODEV; - ccf = devm_kzalloc(&pdev->dev, sizeof(*ccf), GFP_KERNEL); if (!ccf) return -ENOMEM; @@ -189,7 +182,7 @@ static int ccf_probe(struct platform_device *pdev) return PTR_ERR(ccf->regs); ccf->dev = &pdev->dev; - ccf->info = match->data; + ccf->info = device_get_match_data(&pdev->dev); ccf->err_regs = ccf->regs + ccf->info->err_reg_offs; if (ccf->info->has_brr) { -- 2.40.1