Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2043349rdb; Mon, 9 Oct 2023 10:33:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGozTkGbGqqiaFDIo7fL8CGgQl3o8kmNNPOMinIDQXLyt/SO9My2/MgOKcftXagHltD7JjD X-Received: by 2002:a05:6a21:338c:b0:159:e0b9:bd25 with SMTP id yy12-20020a056a21338c00b00159e0b9bd25mr16216197pzb.57.1696872783317; Mon, 09 Oct 2023 10:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696872783; cv=none; d=google.com; s=arc-20160816; b=xXUkuXWBxEHZdfTVf+iAMu/IYNZNnXv8ilFX6bSE2dVLrasdg7K4n1/GYmmqEK1p1+ UruLgRKy9+vLJeW6zPfSAAMaUHhxQY2IbzsCOxw8gK2y8/VgndcQWynlI+0xg9S/pd6f ++arlTUXFodekNR8DKQs/1/TrRVWkNGhrJ0y3hbsQglSRPnjQXM2rpvXOYxVrvMOGGxE F7KMNDx+QmT4XJDSRO4nf2vmZD+GDYiEtd5m4yQARMwboTUnmqreMTviUQFHfdnoA4NH SiEQz1TW1agksIVS2JW4R3XbQ9rn1jWc2Q4RKnYLpyD2HHUqB4g6Qb11vig1BYtn35YA VrVA== 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=18GQz6qiGS6xr9v8sy6Z6Q3i6oqZ7/53+jeO1G6wxKs=; fh=c9zhKwk2nQ0Hrx335srVtchTRy7kxMQ3kKXMPiPZiqI=; b=dxnvhlDC5qPSdp1Eirltx101Oyc8JFZU6Yc4fmzr8zdT9mIyompZewsZu5/dUtYqBj fwIv0QJu03ZWC17PhEest1rop7EQRiaucKezPBJ/mmXQ14MvraGLJ9THRfI++1n6wfsn IpLeCGp+42qZiRxpVLEikuMOn6ICkGDet72CXwiKLLoAW9yDVjYNSIarzCAqqkCLVp4b 3DTKO54Gj4WjxHIRcm4f4csOC2SB5IpHXltinBwGf2p4aXyf1T5SN6Gvw/Ny/3EzFAnl W9DwBm0NL2+R1Y069IMx9ZSvPd3xlLsEUnodiNmJDExPtOCceIZ5Odkd1FYXlA9EQuZm msaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z40JeD4r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id c23-20020aa78c17000000b00690f291a06esi7263273pfd.1.2023.10.09.10.33.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 10:33:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z40JeD4r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id C55F9802E6DC; Mon, 9 Oct 2023 10:32:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377991AbjJIRc3 (ORCPT + 99 others); Mon, 9 Oct 2023 13:32:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377987AbjJIRc1 (ORCPT ); Mon, 9 Oct 2023 13:32:27 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19E43DE for ; Mon, 9 Oct 2023 10:32:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97CF4C433C8; Mon, 9 Oct 2023 17:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696872744; bh=TJcaLAvlDM/rrjbQA5dPMPlECokIUSf7lD2UtWsTWBc=; h=From:To:Cc:Subject:Date:From; b=Z40JeD4ruBmtp+Dr0QAYPc1+X2CJDGfSG9nksOlkJmRghxJQpJ1zWHgtWndh6zvsp BnnZD60Gjwcuh5d0deXFyL4x+SC2Pr0p97i6Fhg9IDSsEYXtSFlJ9Lpi/AXeucRcYg FcYUgPxHIQuXB7k4w31EKLfwRhNdiHf7CEACnajmZAmB8Gk29w8f3o+DuIgwJ/mJ8T EpXOTWKl6uuOw8UO5r60zrMWy0BUEPEovnOOciXQGgFZ61166vfPlI7bAXLFmGf6kH JtrWcoThx3kR5fRpUr4J3L/celDzBQKxEkRvqa5wl+q6yd0Gx6kC5IaWnFGVd7la+I daYg5AP96EkFA== Received: (nullmailer pid 2524703 invoked by uid 1000); Mon, 09 Oct 2023 17:32:22 -0000 From: Rob Herring To: Srinivas Kandagatla , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Maxime Coquelin , Alexandre Torgue Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH] nvmem: Use device_get_match_data() Date: Mon, 9 Oct 2023 12:29:07 -0500 Message-ID: <20231009172923.2457844-12-robh@kernel.org> X-Mailer: git-send-email 2.42.0 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 howler.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 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 10:32:56 -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/nvmem/mxs-ocotp.c | 10 ++++------ drivers/nvmem/stm32-romem.c | 7 ++++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/nvmem/mxs-ocotp.c b/drivers/nvmem/mxs-ocotp.c index 588ab56d75b7..7b78f18f9545 100644 --- a/drivers/nvmem/mxs-ocotp.c +++ b/drivers/nvmem/mxs-ocotp.c @@ -13,8 +13,9 @@ #include #include #include -#include +#include #include +#include #include #include @@ -140,11 +141,10 @@ static int mxs_ocotp_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; const struct mxs_data *data; struct mxs_ocotp *otp; - const struct of_device_id *match; int ret; - match = of_match_device(dev->driver->of_match_table, dev); - if (!match || !match->data) + data = device_get_match_data(dev); + if (!data) return -EINVAL; otp = devm_kzalloc(dev, sizeof(*otp), GFP_KERNEL); @@ -169,8 +169,6 @@ static int mxs_ocotp_probe(struct platform_device *pdev) if (ret) return ret; - data = match->data; - ocotp_config.size = data->size; ocotp_config.priv = otp; ocotp_config.dev = dev; diff --git a/drivers/nvmem/stm32-romem.c b/drivers/nvmem/stm32-romem.c index 1541c20709d2..8a553b1799a8 100644 --- a/drivers/nvmem/stm32-romem.c +++ b/drivers/nvmem/stm32-romem.c @@ -10,7 +10,9 @@ #include #include #include -#include +#include +#include +#include #include #include "stm32-bsec-optee-ta.h" @@ -211,8 +213,7 @@ static int stm32_romem_probe(struct platform_device *pdev) priv->lower = 0; - cfg = (const struct stm32_romem_cfg *) - of_match_device(dev->driver->of_match_table, dev)->data; + cfg = device_get_match_data(dev); if (!cfg) { priv->cfg.read_only = true; priv->cfg.size = resource_size(res); -- 2.42.0