From patchwork Wed Nov 15 21:02:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 165620 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2814308vqg; Wed, 15 Nov 2023 13:12:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlr7s8UkcoDZn+3dhWYbQNthP0OfqfVhfYoXQHmL2jlqnPM28348NnE9xm5iklPgB4f7Uj X-Received: by 2002:a05:6808:2f06:b0:3a9:ba39:6d6e with SMTP id gu6-20020a0568082f0600b003a9ba396d6emr20336900oib.0.1700082727462; Wed, 15 Nov 2023 13:12:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700082727; cv=none; d=google.com; s=arc-20160816; b=PP6LjGc6OwDnO9a2ECuNWjcFoGZ4JsqXcVj3BAMoY0n3K2Uj/Gp62Zu5z2jpaU5spb q403AIkN8u+sp0vp3tD90EvvFMcvdH1QkFW3bwuir0zutx+otubQF6dqe0ZUzJ2Xmerr u+VT2EeCAJgdUfFB5oaWQbF0rsBaS7RAzsu9V1fmkj/g4nZ5wQHbhOdeeU+dxPQMfAJK jYW/bDAn8zRrnfHgqRxzpoKRZ018vwNXDxdeaifBxHKHnzEFrrvqevx02JCqaox3Yna5 3EL4iOArWQ/S+ecizaER3qvmQrRpWfQRjfQWsCvNXyAFoLkG1Jf3SbJzJFnUx+LN3VTT 9taA== 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; bh=T2Lx7bpHkEQXXmBaZiy/OLdr3mXj8JC+CtgHgux9ZD0=; fh=YwH1/rtY0YDpf3ikrLXjvcq2PYyWx4Yz3m7l9DxHGyQ=; b=UxLC4n2FowV9n1lhtbP2OVqnSHnNOMHA0hGoehsC4sxoWglm/BGSZpUV+wxXQwvLFc GxRkQw2LWm03Y/nBWvNF/0+cM2vWUh93RzpjUeB6JjkXB3XPUqBWI5Kjv4BYX8sE6cly 08sF2314uRWWva6AFpIODzp+S8RxzwNKLDRvSdx6ddeNtvgHC69MWpmHo+yWJ6een4OM 0LE6/zOlBK8Blpbt0CNxTYa7fDbTw6gCxJDZ/8zxDt+kT/0IoRyUmG08Y8IFBLfWL68M O9aZmudN8C3MCF27Fi0vaa5/XoH8iF0pEFKDl09/Qf/Lj55ag974chrs0CED/C36G3Sx FMYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id cf12-20020a056a02084c00b005acba4c9bf7si11224784pgb.770.2023.11.15.13.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 13:12:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 287AC8040E9F; Wed, 15 Nov 2023 13:11:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235661AbjKOVLb (ORCPT + 29 others); Wed, 15 Nov 2023 16:11:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229781AbjKOVL3 (ORCPT ); Wed, 15 Nov 2023 16:11:29 -0500 Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26AB5BD; Wed, 15 Nov 2023 13:02:15 -0800 (PST) Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-6ce2eaf7c2bso56667a34.0; Wed, 15 Nov 2023 13:02:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700082134; x=1700686934; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=T2Lx7bpHkEQXXmBaZiy/OLdr3mXj8JC+CtgHgux9ZD0=; b=h8zn7uSeAdlpB+yTkww06+Wf5rYiVB62uuyTVbUb9sBjz5+gr9gwy/+7nRWYpI0tlo /bODdTezf050cKsec5NIt2sSyB13jd5uhpGxpXbQCQVJoTrFC+hOymfwiPQGoJalTM1R CFEgwT5gyQMHaPR3YJGyZmJ35tHrv6oZqsnLEFnrH3nlSFA+cQfstIjSbOYypJAbNCxP W5NaL6glCKdDwD8m1MrlIFpQrKblJR++KusyiIKfqakmrca/E0vDEIVW9cX1YxT/76zF objDxMkk5pB/g6IAin/LJBibdhnBOXej8kNHSX3zJzMh2Q6Qkdx98ASMdyXjTQR5PP3H aX+g== X-Gm-Message-State: AOJu0YxWLYaJgfhulYbty7gYm1eO9bv9mUP7hzBJ0lQg0h/haxW095Mj cwOFqKiuIS+8zkdMTklPkQ== X-Received: by 2002:a05:6830:4109:b0:6ba:865b:ca72 with SMTP id w9-20020a056830410900b006ba865bca72mr7119247ott.31.1700082134428; Wed, 15 Nov 2023 13:02:14 -0800 (PST) Received: from herring.priv (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id t15-20020a9d774f000000b006d653b68fdesm692218otl.55.2023.11.15.13.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 13:02:13 -0800 (PST) Received: (nullmailer pid 3743815 invoked by uid 1000); Wed, 15 Nov 2023 21:02:12 -0000 From: Rob Herring To: Dinh Nguyen , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH] EDAC: altera: Use device_get_match_data() Date: Wed, 15 Nov 2023 15:02:01 -0600 Message-ID: <20231115210201.3743564-1-robh@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 13:11:39 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782665946251502175 X-GMAIL-MSGID: 1782665946251502175 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/edac/altera_edac.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index 8b31cd54bdb6..541acf5eba05 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -279,7 +280,6 @@ static int a10_unmask_irq(struct platform_device *pdev, u32 mask) static int altr_sdram_probe(struct platform_device *pdev) { - const struct of_device_id *id; struct edac_mc_layer layers[2]; struct mem_ctl_info *mci; struct altr_sdram_mc_data *drvdata; @@ -290,10 +290,6 @@ static int altr_sdram_probe(struct platform_device *pdev) int irq, irq2, res = 0; unsigned long mem_size, irqflags = 0; - id = of_match_device(altr_sdram_ctrl_of_match, &pdev->dev); - if (!id) - return -ENODEV; - /* Grab the register range from the sdr controller in device tree */ mc_vbase = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "altr,sdr-syscon"); @@ -304,8 +300,7 @@ static int altr_sdram_probe(struct platform_device *pdev) } /* Check specific dependencies for the module */ - priv = of_match_node(altr_sdram_ctrl_of_match, - pdev->dev.of_node)->data; + priv = device_get_match_data(&pdev->dev); /* Validate the SDRAM controller has ECC enabled */ if (regmap_read(mc_vbase, priv->ecc_ctrl_offset, &read_reg) ||