From patchwork Wed Nov 15 21:03:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 165610 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2810377vqg; Wed, 15 Nov 2023 13:05:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRVEN64YEWcSjBsM3Ug5VJ77qfX3wB/EWSLX0bFV1WWXeiN2a1f5o7bIBEaSvZEUFxNmfO X-Received: by 2002:a05:620a:1645:b0:778:9a8e:57c with SMTP id c5-20020a05620a164500b007789a8e057cmr6175406qko.78.1700082300397; Wed, 15 Nov 2023 13:05:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700082300; cv=none; d=google.com; s=arc-20160816; b=mLJn3+vz7nIyhP+59p04McxbeRNmeTNia3sp5JpJwX+Cd8MIKq5XqXiwsrQWqNBa+k 4WK6WNLXzgsfHEZTTMPsxxCRDGGZhi4VRKMzSRBcWj3dv90sngxfJfYOnCRsbwa71PQw R3s39bXPcjKyArTAC3bTqOriti1wF5fg31QfY6boo8siBEpVyK+mtBCjYELGDP0b5RTs NZ8wG+1fJ5eUIx5ONJp2eYMCRL0zw7Z9//UFsgrF5E9iNKzTrv/b0gD7G/fZxICq/gVb 4IEuYsDBt01RhWKb/R9k6/2RMe/IXyPbv+Q6iCvRkpPN9RYbqZ2Sbpk2BgIDl5ThwvCw h/1g== 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=TOxsynhRcsQpspET2rGRXcJTfs3kg/OnXXBbiAJArDQ=; fh=oPb0qFD19D5JVeoaV81kHZLHdDFwf5sA/nM2sCAfMGY=; b=x2ILa4NA63TkgVIXta9FKSTJLYpSQm5q5pUhT6XtEBIigQAXscB3YS/dRA5ryBBF/D MOpPagUvxJwTrm2ZIzhc//0TURWqf62fxyM0kHbx/ci3MY7ISVXPub71Hxw3skW0r9CH nKl38lWNmVn3k8CbfUFp/xlv1MblESwPXDXDf6SIJoYBfP/vus9woEcXVnxwLUEAO2GL U5sJNDglsXKgTqcpQqMA4PSw8aLeECELC0QQHaOuKP9qB7JaVTKz3v6dGaC4IKsNOT1b 7dsbIgX49K/xkK2/V53V+evjCR3sNz7cMICEzoO8IJg04qc1FI9ukwGw04q/E+bYB529 TADA== 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:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id ee1-20020a05620a800100b00778a0d33554si10571427qkb.103.2023.11.15.13.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 13:05:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 7BE8D80AA267; Wed, 15 Nov 2023 13:04:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344662AbjKOVER (ORCPT + 29 others); Wed, 15 Nov 2023 16:04:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344976AbjKOVDy (ORCPT ); Wed, 15 Nov 2023 16:03:54 -0500 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 424B2198A for ; Wed, 15 Nov 2023 13:03:27 -0800 (PST) Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6ce2eaf7c2bso57303a34.0 for ; Wed, 15 Nov 2023 13:03:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700082206; x=1700687006; 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=TOxsynhRcsQpspET2rGRXcJTfs3kg/OnXXBbiAJArDQ=; b=dY+t5j+hLHYt/lLZLfBwshbsBd4ETEpBXGPArBaATBQ9PslcN4VtxWPnCyGTmuNvTu RFvFAqnFS5spjo/a7udSIO4FQsmb1skDf6suOKWUMIxdKpH1/WcbwJK0IM4SOs8Ab/yt mIYZEudx2qpmWjQpamdsypnV6KWJSNeIZRgR9d2LUhIU588q3SjDGo4sEkGIwMfYpb4z KjANBP6N/FuVtTPqLtByh+b0q0gz88sCrehstOc5djZEPdApNf2XXc3ARDNh6fCsBG5C VWhrV1eQCCk1aKymFmJ3D9BnxK+o6F0FqZCHEPG1IKnJt0pyJZV31Mh4FO5qoEGt/hTM 7KQQ== X-Gm-Message-State: AOJu0YwIoDKD6C6yenngDxfBuv2r51LAiPP+vIqQoKUcvY/+4utUNY/f KqpeQ31vdfu+R+rvEPpyYA== X-Received: by 2002:a9d:6441:0:b0:6b8:7eef:a236 with SMTP id m1-20020a9d6441000000b006b87eefa236mr6280865otl.30.1700082206536; Wed, 15 Nov 2023 13:03:26 -0800 (PST) Received: from herring.priv (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id a18-20020a056830101200b006cdf9935af2sm494337otp.53.2023.11.15.13.03.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 13:03:25 -0800 (PST) Received: (nullmailer pid 3747903 invoked by uid 1000); Wed, 15 Nov 2023 21:03:25 -0000 From: Rob Herring To: Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH] ARM: imx: Use device_get_match_data() Date: Wed, 15 Nov 2023 15:03:18 -0600 Message-ID: <20231115210319.3747145-1-robh@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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]); Wed, 15 Nov 2023 13:04:51 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782665498123471537 X-GMAIL-MSGID: 1782665498123471537 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 --- arch/arm/mach-imx/mmdc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index 2157493b78a9..897e6def59ee 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -13,7 +13,8 @@ #include #include #include -#include +#include +#include #include #include @@ -103,7 +104,7 @@ struct mmdc_pmu { struct device *dev; struct perf_event *mmdc_events[MMDC_NUM_COUNTERS]; struct hlist_node node; - struct fsl_mmdc_devtype_data *devtype_data; + const struct fsl_mmdc_devtype_data *devtype_data; struct clk *mmdc_ipg_clk; }; @@ -474,8 +475,6 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b struct mmdc_pmu *pmu_mmdc; char *name; int ret; - const struct of_device_id *of_id = - of_match_device(imx_mmdc_dt_ids, &pdev->dev); pmu_mmdc = kzalloc(sizeof(*pmu_mmdc), GFP_KERNEL); if (!pmu_mmdc) { @@ -503,7 +502,7 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b GFP_KERNEL, "mmdc%d", ret); pmu_mmdc->mmdc_ipg_clk = mmdc_ipg_clk; - pmu_mmdc->devtype_data = (struct fsl_mmdc_devtype_data *)of_id->data; + pmu_mmdc->devtype_data = device_get_match_data(&pdev->dev); hrtimer_init(&pmu_mmdc->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);