Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp931529rdb; Fri, 20 Oct 2023 03:56:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtSpcrYqnBzfu7wJVrGi9Rfo6SmtMJtkU/sqUTP3nLqdFl/uUmKv0E02VqV1glHWSdVw/d X-Received: by 2002:a05:6870:12d0:b0:1d6:8b7f:ce89 with SMTP id 16-20020a05687012d000b001d68b7fce89mr1277222oam.51.1697799408531; Fri, 20 Oct 2023 03:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697799408; cv=none; d=google.com; s=arc-20160816; b=PsayF0YV/JD1zQVa4xjouMIJTnJIGm4ht67Xy4r6pUxPBOLmOlaRSIKZtFbwXwGg8P nwhAST/RGhou5+v+iM4mVoNPuTWn020n8dP5zEmKLdWiXzoQtNl5CLBFVssc/5J0yGuZ 9/WF57Lg60U9IiecGCR7u9s7QXp0ni+T5uWgyuhCxekSUxPWfqrUSVu3LZU1noWpHe2y Yk3qdTeMQITD+HL2tJ60cgdWOF2IC9DuCrbq3CBBX70aYyNgxV1YdtqBJhwUwWr5m5kC vq1nelr06uv2NKMd9odGPypbJK+vfw7GH+BmNfK2U6XC1vIumh2R0u1HQoH6f1yynHYX n+Xg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LBaYQeYiD1YuZrxxKEylzAW4K+YG4Ht4dFex9adnBRY=; fh=3podjJk0UlP544BUncw9FPdwIiLSoiFiT1rKSBe254A=; b=TaPr+BfAB+w0f8lvFwMv4g/rEvT6TKfZqT8zCsfATUNdsgj8kcFHV4Os3HhKikyFwQ inanDmqkkuQAZtR8z7NZ5k0nAUeLaC1OKksJEJWIpAIspefcys9VEKimpo+MTJDi3tdT XgTlBNXgrJ+DldKZUmZmkpQB24vkfijh5RpiLc7XPE0Rrd9Ct/Ums5z92xCQ8W5TTip1 Rke1u0zwf1wQhMVvwT9IuPlkqLDS7eJUEeupBaLxOirG6liKWKVM/GrvvwnvSKY6fcTJ suWA4eLNLZ+/wUbkvHNQ74+ahoF0E+f4vZCabEIwQ3SGA/DrP8aJk/Aq2RVu6xO8Yazn FmNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=temMAmEq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id l24-20020a637018000000b005898e10f9b9si1582369pgc.213.2023.10.20.03.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:56:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=temMAmEq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 2BC0283D10F9; Fri, 20 Oct 2023 03:56:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377165AbjJTK4d (ORCPT + 99 others); Fri, 20 Oct 2023 06:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377103AbjJTK4N (ORCPT ); Fri, 20 Oct 2023 06:56:13 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77769119 for ; Fri, 20 Oct 2023 03:56:10 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2bb9a063f26so9453531fa.2 for ; Fri, 20 Oct 2023 03:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799369; x=1698404169; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LBaYQeYiD1YuZrxxKEylzAW4K+YG4Ht4dFex9adnBRY=; b=temMAmEq3V2ZdHFjHX32kMzOz26wqA2b43xqwQuRZ43ZCpjAtv8Xa91xZt7+74YgrG kwJxceX8OIEKYraXHI9gd5ZoKngnF1ucxYxXE81y3ICIHlVgzDIRAeaRB/xfHHkuF4Lm B1jamBTQ1fE2/mL9KdsfjIweFA/dUgIFeO8/FmIYXta6sKJ5uuBoayiU96ZXesCuTDHx yZIe3L8Lc3f3QbZPHSkv0LiF9TURmWspa8XqqGlEKrLCYV2UubNJkrV04Psw/cA2wK4K LTBJTDCnwBFzEIWW6Kq1AHbnrqz3POlcUDtmd2fJYOro/aIb+BdUHL/8flBMvt61zj29 hA+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799369; x=1698404169; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LBaYQeYiD1YuZrxxKEylzAW4K+YG4Ht4dFex9adnBRY=; b=gciiF4TFf9wr/0KQzC53qa2Z7TotqVOu7EGr4gtJyBhL6xel8gfM3df2onX2gQr7dj K2am/9ci3u3G67Y0/svWlItVcVTy/OBrI5L0PSQzgLd9uRcMVNXmDOhldfd2eSXu1MwS OI6tfDLL4QWKxSLrRvve+H/XE63qOn8oY5n5jthnYaHAQlM/5RKDQ8a2v2XcE02GxcPP fmSmvTpOV4SdMbvaHVh0XNb+9GJc3bHqhe8508KggJ1DzbYyO2LYjV1I59JAYtOqyu8Q WCaasEQOujZneS7iR/LfR8ons4aDYZ+r3tfBcuueak6B8T1rTG2TI+3PoDOyO1PSWTwq mEeg== X-Gm-Message-State: AOJu0YyX8ZrazByzcypoqmHbKXUW/CaFiOZjJMTVXyUGq7Qml9C7wp27 rWl9VMhTmVCCAllqJEAIkj15VqErPMjgJgbbGuQ= X-Received: by 2002:a2e:a7d2:0:b0:2c1:5645:a2c0 with SMTP id x18-20020a2ea7d2000000b002c15645a2c0mr1398424ljp.35.1697799368791; Fri, 20 Oct 2023 03:56:08 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id x9-20020a05600c420900b004065e235417sm6578937wmh.21.2023.10.20.03.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:56:07 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Rob Herring , Srinivas Kandagatla Subject: [PATCH 6/6] nvmem: Use device_get_match_data() Date: Fri, 20 Oct 2023 11:55:45 +0100 Message-Id: <20231020105545.216052-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231020105545.216052-1-srinivas.kandagatla@linaro.org> References: <20231020105545.216052-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 03:56:46 -0700 (PDT) From: Rob Herring 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 Signed-off-by: Srinivas Kandagatla --- 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.25.1