From nobody Wed Dec 17 09:46:00 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC55BCDB474 for ; Fri, 20 Oct 2023 10:56:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377129AbjJTK4Z (ORCPT ); Fri, 20 Oct 2023 06:56:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377025AbjJTK4K (ORCPT ); Fri, 20 Oct 2023 06:56:10 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E99119 for ; Fri, 20 Oct 2023 03:56:04 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40806e4106dso4024685e9.1 for ; Fri, 20 Oct 2023 03:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799362; x=1698404162; 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=+uq/c1O+wi+Li74Qe8dqIPXwWq5ovqnWT6YA9szi7Fs=; b=mN8QUuP/+XweH1SoMTJQEyvqUoVGVrK6DQLYbEVMBuXn5mEDsn+iMFU1gKxpF1dIuX 8B7WOarSVLK7A2O38jCuSy68vgsH+SoEpL/USC+nN7051WSSHfi1k5EHUrrQM2389skv plIQCtMEC76l7uOIZDgto2+XiFR/TyY9GsfJxf8d181FHir6P3hxUA5FgsQrmHg59h1g P4pmxYp3lwgG/UdX/wWuSQNwN76AES/ZqJh/S6bv5Mwgt654uLjCxvuAZw2Xb7xGk7uU idKRJbRYirqgmRE63PTcoB51gN9jevXsiK1N6jh4VIREoFHckCKtJeVnxAl01eQV8BiN p7NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799362; x=1698404162; 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=+uq/c1O+wi+Li74Qe8dqIPXwWq5ovqnWT6YA9szi7Fs=; b=Tmi8pD1LzbcwWnRRGiXwvD5B7fZjXkNuohS5muFX5dmEpZdFgs2P3QMbzzEnbbx6vS oRZ1DvoDwR82QbNYGY/oDusiA8TMGME1stE/CSbClZAo7sbECr5gRKKwoN+Jj7SK2F5e rvl1kmhrBmRtouuRmy27+jDGqjchtntBdJX9upQOdt5j8iV5CbmnnqjuAZXHzm5UQZSF 4GtJhm/wzH3WJoKlDJotrayH6u3yuGSsrwZTIXDo3Il/H7t4MIDRw0gbP8ptJifHc997 /HLzTpJM3WKrMNxm6kPOgxiAricyU/8WdjVjlSNc4nLQ55t1I/UYk6Q5+tEKkM/Jih6W 8DgA== X-Gm-Message-State: AOJu0YwNIknM4kkOCJhPCwS7yKDhFEBSJEGxDGF7/GNeg/QQxghR+aUV ntxTB5S+kIKtBm1NIRjgxygHvg== X-Google-Smtp-Source: AGHT+IG7PpN/tjXyv0xHLXNWMr2ATDIZzu5+J/2D2g/LohU+cWxtY9aJ/x2INvqbWGVB1+lKEBN7VA== X-Received: by 2002:a05:600c:1d26:b0:405:3924:3cad with SMTP id l38-20020a05600c1d2600b0040539243cadmr1373735wms.15.1697799362557; Fri, 20 Oct 2023 03:56:02 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:56:01 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Luca Weiss , Douglas Anderson , Srinivas Kandagatla Subject: [PATCH 1/6] nvmem: qfprom: Mark core clk as optional Date: Fri, 20 Oct 2023 11:55:40 +0100 Message-Id: <20231020105545.216052-2-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Luca Weiss On some platforms like sc7280 on non-ChromeOS devices the core clock cannot be touched by Linux so we cannot provide it. Mark it as optional as accessing qfprom for reading works without it but we still prohibit writing if we cannot provide the clock. Signed-off-by: Luca Weiss Reviewed-by: Douglas Anderson Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/qfprom.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c index 14814cba2dd6..525be03b7bba 100644 --- a/drivers/nvmem/qfprom.c +++ b/drivers/nvmem/qfprom.c @@ -423,12 +423,12 @@ static int qfprom_probe(struct platform_device *pdev) if (IS_ERR(priv->vcc)) return PTR_ERR(priv->vcc); =20 - priv->secclk =3D devm_clk_get(dev, "core"); + priv->secclk =3D devm_clk_get_optional(dev, "core"); if (IS_ERR(priv->secclk)) return dev_err_probe(dev, PTR_ERR(priv->secclk), "Error getting clock\n= "); =20 - /* Only enable writing if we have SoC data. */ - if (priv->soc_data) + /* Only enable writing if we have SoC data and a valid clock */ + if (priv->soc_data && priv->secclk) econfig.reg_write =3D qfprom_reg_write; } =20 --=20 2.25.1 From nobody Wed Dec 17 09:46:00 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F1CFCDB474 for ; Fri, 20 Oct 2023 10:56:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377151AbjJTK4V (ORCPT ); Fri, 20 Oct 2023 06:56:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377018AbjJTK4K (ORCPT ); Fri, 20 Oct 2023 06:56:10 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E9C1CA for ; Fri, 20 Oct 2023 03:56:05 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-407c3adef8eso5684325e9.2 for ; Fri, 20 Oct 2023 03:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799364; x=1698404164; 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=dyrgqfjPSG0wVAtLEVKnZM/LIpobQ9gTCztYcpYP7eM=; b=oaRB2dvW4NJDNrz0QWV0YXDdhpcUszLVzubhYANZgsYeMdwiqXmsrDTSqA8D7sPReW 9L1LPcyGpXvwzmE4Li0GXw5HBNqgeBRmkezsesBis5alBhLb4WqWNqEGgeEbreuebpQw jbmknydeLS45B/5Kg9ttxXwmc3QwdQ3vYX7eqfIXW/AZCwywCKGm5DV5HC372VtrJlYa kvWYUumbd0ruETNRtFRSj3rC18w4s7nz5WzYHFZS4sGmR7apqTuSmtwmrsF5WyGm0vSM 6kY8jfq2rkYPsO/ODFh0Is0PSPVAS/P5tuhuLOmjUdxcbMnwwAl7D5YW4iSAWGyPZvao fD8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799364; x=1698404164; 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=dyrgqfjPSG0wVAtLEVKnZM/LIpobQ9gTCztYcpYP7eM=; b=qnznnMEHFoWnscCK9S0w/LaOPEFa3SgEMTsBAOf6AAmAgfw10R/5G/OvuIL7q2ts9u jehbkUeuqI8YfQNmN6j2JI5Zwy3otVEUtucQtp1+IieB4v/gttYY2O6V9p2D1qrW6WsV su2TtqqfQAx3P+CnoP+09q4DYGXjocXWhFJ2XthjVa55+12vYpK2iGbJowS+Yg6Tr6Vs XTyvaJYdU9HyB5ccc3EWw5o34Exz1ImfhGAj3NF/8yW10ISLU1kuiyMPcfjk26Q9PxCf kVIInjQRiw/hBjdU9+1PSV89WbR07a3cyZ4HFe9lpwel0EC+Tb7P7JvNuLj8RA62rafL GdiA== X-Gm-Message-State: AOJu0YzraYKKg+h2MYkmdLJ3fPjxxenIRNF6Q7Dzechrm2cg6ZjLLkoN DwsZscEZM+xqRAb5+vhxZP/alA== X-Google-Smtp-Source: AGHT+IG9lDmOpHZ8p9uhiVid3pYZHTS6V7bDkv6dU0REjMlCssGoDiZkky8Uv7MmaQpBg8TzHGp6ew== X-Received: by 2002:a05:600c:a47:b0:408:3e7a:82ea with SMTP id c7-20020a05600c0a4700b004083e7a82eamr1210773wmq.1.1697799363879; Fri, 20 Oct 2023 03:56:03 -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.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:56:03 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Martin Blumenstingl , AngeloGioacchino Del Regno , Claudiu Beznea , Jernej Skrabec , Srinivas Kandagatla Subject: [PATCH 2/6] nvmem: add explicit config option to read old syntax fixed OF cells Date: Fri, 20 Oct 2023 11:55:41 +0100 Message-Id: <20231020105545.216052-3-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafa=C5=82 Mi=C5=82ecki Binding for fixed NVMEM cells defined directly as NVMEM device subnodes has been deprecated. It has been replaced by the "fixed-layout" NVMEM layout binding. New syntax is meant to be clearer and should help avoiding imprecise bindings. NVMEM subsystem already supports the new binding. It should be a good idea to limit support for old syntax to existing drivers that actually support & use it (we can't break backward compatibility!). That way we additionally encourage new bindings & drivers to ignore deprecated binding. It wasn't clear (to me) if rtc and w1 code actually uses old syntax fixed cells. I enabled them to don't risk any breakage. Signed-off-by: Rafa=C5=82 Mi=C5=82ecki [for meson-{efuse,mx-efuse}.c] Acked-by: Martin Blumenstingl [for mtk-efuse.c, nvmem/core.c, nvmem-provider.h] Reviewed-by: AngeloGioacchino Del Regno [MT8192, MT8195 Chromebooks] Tested-by: AngeloGioacchino Del Regno [for microchip-otpc.c] Reviewed-by: Claudiu Beznea [SAMA7G5-EK] Tested-by: Claudiu Beznea Acked-by: Jernej Skrabec Signed-off-by: Srinivas Kandagatla --- drivers/mtd/mtdcore.c | 2 ++ drivers/nvmem/apple-efuses.c | 1 + drivers/nvmem/core.c | 8 +++++--- drivers/nvmem/imx-ocotp-scu.c | 1 + drivers/nvmem/imx-ocotp.c | 1 + drivers/nvmem/meson-efuse.c | 1 + drivers/nvmem/meson-mx-efuse.c | 1 + drivers/nvmem/microchip-otpc.c | 1 + drivers/nvmem/mtk-efuse.c | 1 + drivers/nvmem/qcom-spmi-sdam.c | 1 + drivers/nvmem/qfprom.c | 1 + drivers/nvmem/rave-sp-eeprom.c | 1 + drivers/nvmem/rockchip-efuse.c | 1 + drivers/nvmem/sc27xx-efuse.c | 1 + drivers/nvmem/sec-qfprom.c | 1 + drivers/nvmem/sprd-efuse.c | 1 + drivers/nvmem/stm32-romem.c | 1 + drivers/nvmem/sunplus-ocotp.c | 1 + drivers/nvmem/sunxi_sid.c | 1 + drivers/nvmem/uniphier-efuse.c | 1 + drivers/nvmem/zynqmp_nvmem.c | 1 + drivers/rtc/nvmem.c | 1 + drivers/w1/slaves/w1_ds250x.c | 1 + include/linux/nvmem-provider.h | 2 ++ 24 files changed, 30 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 9bd661be3ae9..fbf60d1364f0 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -552,6 +552,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd) config.dev =3D &mtd->dev; config.name =3D dev_name(&mtd->dev); config.owner =3D THIS_MODULE; + config.add_legacy_fixed_of_cells =3D of_device_is_compatible(node, "nvmem= -cells"); config.reg_read =3D mtd_nvmem_reg_read; config.size =3D mtd->size; config.word_size =3D 1; @@ -898,6 +899,7 @@ static struct nvmem_device *mtd_otp_nvmem_register(stru= ct mtd_info *mtd, config.name =3D compatible; config.id =3D NVMEM_DEVID_AUTO; config.owner =3D THIS_MODULE; + config.add_legacy_fixed_of_cells =3D true; config.type =3D NVMEM_TYPE_OTP; config.root_only =3D true; config.ignore_wp =3D true; diff --git a/drivers/nvmem/apple-efuses.c b/drivers/nvmem/apple-efuses.c index 9b7c87102104..d3d49d22338b 100644 --- a/drivers/nvmem/apple-efuses.c +++ b/drivers/nvmem/apple-efuses.c @@ -36,6 +36,7 @@ static int apple_efuses_probe(struct platform_device *pde= v) struct resource *res; struct nvmem_config config =3D { .dev =3D &pdev->dev, + .add_legacy_fixed_of_cells =3D true, .read_only =3D true, .reg_read =3D apple_efuses_read, .stride =3D sizeof(u32), diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index eaf6a3fe8ca6..2710943f53c4 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -997,9 +997,11 @@ struct nvmem_device *nvmem_register(const struct nvmem= _config *config) if (rval) goto err_remove_cells; =20 - rval =3D nvmem_add_cells_from_legacy_of(nvmem); - if (rval) - goto err_remove_cells; + if (config->add_legacy_fixed_of_cells) { + rval =3D nvmem_add_cells_from_legacy_of(nvmem); + if (rval) + goto err_remove_cells; + } =20 rval =3D nvmem_add_cells_from_fixed_layout(nvmem); if (rval) diff --git a/drivers/nvmem/imx-ocotp-scu.c b/drivers/nvmem/imx-ocotp-scu.c index c38d9c1c3f48..517d83e11af2 100644 --- a/drivers/nvmem/imx-ocotp-scu.c +++ b/drivers/nvmem/imx-ocotp-scu.c @@ -220,6 +220,7 @@ static int imx_scu_ocotp_write(void *context, unsigned = int offset, =20 static struct nvmem_config imx_scu_ocotp_nvmem_config =3D { .name =3D "imx-scu-ocotp", + .add_legacy_fixed_of_cells =3D true, .read_only =3D false, .word_size =3D 4, .stride =3D 1, diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index a223d9537f22..434f197e27bf 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -615,6 +615,7 @@ static int imx_ocotp_probe(struct platform_device *pdev) return PTR_ERR(priv->clk); =20 priv->params =3D of_device_get_match_data(&pdev->dev); + imx_ocotp_nvmem_config.add_legacy_fixed_of_cells =3D true; imx_ocotp_nvmem_config.size =3D 4 * priv->params->nregs; imx_ocotp_nvmem_config.dev =3D dev; imx_ocotp_nvmem_config.priv =3D priv; diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c index d6b533497ce1..b922df99f9bc 100644 --- a/drivers/nvmem/meson-efuse.c +++ b/drivers/nvmem/meson-efuse.c @@ -93,6 +93,7 @@ static int meson_efuse_probe(struct platform_device *pdev) =20 econfig->dev =3D dev; econfig->name =3D dev_name(dev); + econfig->add_legacy_fixed_of_cells =3D true; econfig->stride =3D 1; econfig->word_size =3D 1; econfig->reg_read =3D meson_efuse_read; diff --git a/drivers/nvmem/meson-mx-efuse.c b/drivers/nvmem/meson-mx-efuse.c index d6d7aeda31f9..3ff04d5ca8f8 100644 --- a/drivers/nvmem/meson-mx-efuse.c +++ b/drivers/nvmem/meson-mx-efuse.c @@ -210,6 +210,7 @@ static int meson_mx_efuse_probe(struct platform_device = *pdev) efuse->config.owner =3D THIS_MODULE; efuse->config.dev =3D &pdev->dev; efuse->config.priv =3D efuse; + efuse->config.add_legacy_fixed_of_cells =3D true; efuse->config.stride =3D drvdata->word_size; efuse->config.word_size =3D drvdata->word_size; efuse->config.size =3D SZ_512; diff --git a/drivers/nvmem/microchip-otpc.c b/drivers/nvmem/microchip-otpc.c index 436e0dc4f337..7cf81738a3e0 100644 --- a/drivers/nvmem/microchip-otpc.c +++ b/drivers/nvmem/microchip-otpc.c @@ -261,6 +261,7 @@ static int mchp_otpc_probe(struct platform_device *pdev) return ret; =20 mchp_nvmem_config.dev =3D otpc->dev; + mchp_nvmem_config.add_legacy_fixed_of_cells =3D true; mchp_nvmem_config.size =3D size; mchp_nvmem_config.priv =3D otpc; nvmem =3D devm_nvmem_register(&pdev->dev, &mchp_nvmem_config); diff --git a/drivers/nvmem/mtk-efuse.c b/drivers/nvmem/mtk-efuse.c index b36cd0dcc8c7..87c94686cfd2 100644 --- a/drivers/nvmem/mtk-efuse.c +++ b/drivers/nvmem/mtk-efuse.c @@ -83,6 +83,7 @@ static int mtk_efuse_probe(struct platform_device *pdev) return PTR_ERR(priv->base); =20 pdata =3D device_get_match_data(dev); + econfig.add_legacy_fixed_of_cells =3D true; econfig.stride =3D 1; econfig.word_size =3D 1; econfig.reg_read =3D mtk_reg_read; diff --git a/drivers/nvmem/qcom-spmi-sdam.c b/drivers/nvmem/qcom-spmi-sdam.c index 70f2d4f2efbf..9aa8f42faa4c 100644 --- a/drivers/nvmem/qcom-spmi-sdam.c +++ b/drivers/nvmem/qcom-spmi-sdam.c @@ -142,6 +142,7 @@ static int sdam_probe(struct platform_device *pdev) sdam->sdam_config.name =3D "spmi_sdam"; sdam->sdam_config.id =3D NVMEM_DEVID_AUTO; sdam->sdam_config.owner =3D THIS_MODULE; + sdam->sdam_config.add_legacy_fixed_of_cells =3D true; sdam->sdam_config.stride =3D 1; sdam->sdam_config.word_size =3D 1; sdam->sdam_config.reg_read =3D sdam_read; diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c index 525be03b7bba..116a39e804c7 100644 --- a/drivers/nvmem/qfprom.c +++ b/drivers/nvmem/qfprom.c @@ -357,6 +357,7 @@ static int qfprom_probe(struct platform_device *pdev) { struct nvmem_config econfig =3D { .name =3D "qfprom", + .add_legacy_fixed_of_cells =3D true, .stride =3D 1, .word_size =3D 1, .id =3D NVMEM_DEVID_AUTO, diff --git a/drivers/nvmem/rave-sp-eeprom.c b/drivers/nvmem/rave-sp-eeprom.c index df6a1c594b78..9ecf3873cbb7 100644 --- a/drivers/nvmem/rave-sp-eeprom.c +++ b/drivers/nvmem/rave-sp-eeprom.c @@ -328,6 +328,7 @@ static int rave_sp_eeprom_probe(struct platform_device = *pdev) of_property_read_string(np, "zii,eeprom-name", &config.name); config.priv =3D eeprom; config.dev =3D dev; + config.add_legacy_fixed_of_cells =3D true; config.size =3D size; config.reg_read =3D rave_sp_eeprom_reg_read; config.reg_write =3D rave_sp_eeprom_reg_write; diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c index 4004c5bece42..2b40978ddb18 100644 --- a/drivers/nvmem/rockchip-efuse.c +++ b/drivers/nvmem/rockchip-efuse.c @@ -205,6 +205,7 @@ static int rockchip_rk3399_efuse_read(void *context, un= signed int offset, =20 static struct nvmem_config econfig =3D { .name =3D "rockchip-efuse", + .add_legacy_fixed_of_cells =3D true, .stride =3D 1, .word_size =3D 1, .read_only =3D true, diff --git a/drivers/nvmem/sc27xx-efuse.c b/drivers/nvmem/sc27xx-efuse.c index 2210da40dfbd..bff27011f4ff 100644 --- a/drivers/nvmem/sc27xx-efuse.c +++ b/drivers/nvmem/sc27xx-efuse.c @@ -247,6 +247,7 @@ static int sc27xx_efuse_probe(struct platform_device *p= dev) econfig.reg_read =3D sc27xx_efuse_read; econfig.priv =3D efuse; econfig.dev =3D &pdev->dev; + econfig.add_legacy_fixed_of_cells =3D true; nvmem =3D devm_nvmem_register(&pdev->dev, &econfig); if (IS_ERR(nvmem)) { dev_err(&pdev->dev, "failed to register nvmem config\n"); diff --git a/drivers/nvmem/sec-qfprom.c b/drivers/nvmem/sec-qfprom.c index e48c2dc0c44b..19799b3fe00a 100644 --- a/drivers/nvmem/sec-qfprom.c +++ b/drivers/nvmem/sec-qfprom.c @@ -47,6 +47,7 @@ static int sec_qfprom_probe(struct platform_device *pdev) { struct nvmem_config econfig =3D { .name =3D "sec-qfprom", + .add_legacy_fixed_of_cells =3D true, .stride =3D 1, .word_size =3D 1, .id =3D NVMEM_DEVID_AUTO, diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c index 7e6e31db4baa..bb3105f3291f 100644 --- a/drivers/nvmem/sprd-efuse.c +++ b/drivers/nvmem/sprd-efuse.c @@ -408,6 +408,7 @@ static int sprd_efuse_probe(struct platform_device *pde= v) econfig.read_only =3D false; econfig.name =3D "sprd-efuse"; econfig.size =3D efuse->data->blk_nums * SPRD_EFUSE_BLOCK_WIDTH; + econfig.add_legacy_fixed_of_cells =3D true; econfig.reg_read =3D sprd_efuse_read; econfig.reg_write =3D sprd_efuse_write; econfig.priv =3D efuse; diff --git a/drivers/nvmem/stm32-romem.c b/drivers/nvmem/stm32-romem.c index 0f84044bd1ad..1541c20709d2 100644 --- a/drivers/nvmem/stm32-romem.c +++ b/drivers/nvmem/stm32-romem.c @@ -207,6 +207,7 @@ static int stm32_romem_probe(struct platform_device *pd= ev) priv->cfg.priv =3D priv; priv->cfg.owner =3D THIS_MODULE; priv->cfg.type =3D NVMEM_TYPE_OTP; + priv->cfg.add_legacy_fixed_of_cells =3D true; =20 priv->lower =3D 0; =20 diff --git a/drivers/nvmem/sunplus-ocotp.c b/drivers/nvmem/sunplus-ocotp.c index f3a18aa0a6c7..38f5d9df39cd 100644 --- a/drivers/nvmem/sunplus-ocotp.c +++ b/drivers/nvmem/sunplus-ocotp.c @@ -145,6 +145,7 @@ static int sp_ocotp_read(void *priv, unsigned int offse= t, void *value, size_t by =20 static struct nvmem_config sp_ocotp_nvmem_config =3D { .name =3D "sp-ocotp", + .add_legacy_fixed_of_cells =3D true, .read_only =3D true, .word_size =3D 1, .size =3D QAC628_OTP_SIZE, diff --git a/drivers/nvmem/sunxi_sid.c b/drivers/nvmem/sunxi_sid.c index 5d364d85347f..ba14a76208ab 100644 --- a/drivers/nvmem/sunxi_sid.c +++ b/drivers/nvmem/sunxi_sid.c @@ -153,6 +153,7 @@ static int sunxi_sid_probe(struct platform_device *pdev) nvmem_cfg->dev =3D dev; nvmem_cfg->name =3D "sunxi-sid"; nvmem_cfg->type =3D NVMEM_TYPE_OTP; + nvmem_cfg->add_legacy_fixed_of_cells =3D true; nvmem_cfg->read_only =3D true; nvmem_cfg->size =3D cfg->size; nvmem_cfg->word_size =3D 1; diff --git a/drivers/nvmem/uniphier-efuse.c b/drivers/nvmem/uniphier-efuse.c index 0a1dbb80537e..6ad3295d3195 100644 --- a/drivers/nvmem/uniphier-efuse.c +++ b/drivers/nvmem/uniphier-efuse.c @@ -52,6 +52,7 @@ static int uniphier_efuse_probe(struct platform_device *p= dev) econfig.size =3D resource_size(res); econfig.priv =3D priv; econfig.dev =3D dev; + econfig.add_legacy_fixed_of_cells =3D true; nvmem =3D devm_nvmem_register(dev, &econfig); =20 return PTR_ERR_OR_ZERO(nvmem); diff --git a/drivers/nvmem/zynqmp_nvmem.c b/drivers/nvmem/zynqmp_nvmem.c index f49bb9a26d05..7f15aa89a9d0 100644 --- a/drivers/nvmem/zynqmp_nvmem.c +++ b/drivers/nvmem/zynqmp_nvmem.c @@ -58,6 +58,7 @@ static int zynqmp_nvmem_probe(struct platform_device *pde= v) =20 priv->dev =3D dev; econfig.dev =3D dev; + econfig.add_legacy_fixed_of_cells =3D true; econfig.reg_read =3D zynqmp_nvmem_read; econfig.priv =3D priv; =20 diff --git a/drivers/rtc/nvmem.c b/drivers/rtc/nvmem.c index 07ede21cee34..37df7e80525b 100644 --- a/drivers/rtc/nvmem.c +++ b/drivers/rtc/nvmem.c @@ -21,6 +21,7 @@ int devm_rtc_nvmem_register(struct rtc_device *rtc, =20 nvmem_config->dev =3D dev; nvmem_config->owner =3D rtc->owner; + nvmem_config->add_legacy_fixed_of_cells =3D true; nvmem =3D devm_nvmem_register(dev, nvmem_config); if (IS_ERR(nvmem)) dev_err(dev, "failed to register nvmem device for RTC\n"); diff --git a/drivers/w1/slaves/w1_ds250x.c b/drivers/w1/slaves/w1_ds250x.c index 7592c7050d1d..cb426f7dd23d 100644 --- a/drivers/w1/slaves/w1_ds250x.c +++ b/drivers/w1/slaves/w1_ds250x.c @@ -168,6 +168,7 @@ static int w1_eprom_add_slave(struct w1_slave *sl) struct nvmem_device *nvmem; struct nvmem_config nvmem_cfg =3D { .dev =3D &sl->dev, + .add_legacy_fixed_of_cells =3D true, .reg_read =3D w1_nvmem_read, .type =3D NVMEM_TYPE_OTP, .read_only =3D true, diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index dae26295e6be..1b81adebdb8b 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -82,6 +82,7 @@ struct nvmem_cell_info { * @owner: Pointer to exporter module. Used for refcounting. * @cells: Optional array of pre-defined NVMEM cells. * @ncells: Number of elements in cells. + * @add_legacy_fixed_of_cells: Read fixed NVMEM cells from old OF syntax. * @keepout: Optional array of keepout ranges (sorted ascending by start). * @nkeepout: Number of elements in the keepout array. * @type: Type of the nvmem storage @@ -112,6 +113,7 @@ struct nvmem_config { struct module *owner; const struct nvmem_cell_info *cells; int ncells; + bool add_legacy_fixed_of_cells; const struct nvmem_keepout *keepout; unsigned int nkeepout; enum nvmem_type type; --=20 2.25.1 From nobody Wed Dec 17 09:46:00 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75465CDB47E for ; Fri, 20 Oct 2023 10:56:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377112AbjJTK4O (ORCPT ); Fri, 20 Oct 2023 06:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377051AbjJTK4K (ORCPT ); Fri, 20 Oct 2023 06:56:10 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9D48E8 for ; Fri, 20 Oct 2023 03:56:06 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40651a72807so5097895e9.1 for ; Fri, 20 Oct 2023 03:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799365; x=1698404165; 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=YRbaZ8Ef1/VZbZ1Yxpg4ZanC3ZxTD3DH0ZyYq9tLTZ8=; b=d+hd1qrNILTFjR/0SeUcj6Rll7b/BuymtKDBiYfUHu9bJMKRaw5HQinl1ei7eRhgd1 /BJ7sRWk3S6MZ3EGqItbhK0JI/88HdlcKhdEyoq0LGFFVwVk6RfpQ2IdqVGaDOgoyyjG GCOao622pz6gWGyc4Kt13Y31It83PEIBI90yPYTfgyR4oh9hYUFhemOae3qerkO9YCXV 6pyIgwvkKFy1V9mAg8FoDLlL6RiPjrVmyDJgHMQ7PJnyd8Os8RW7+qGBCrkUFS30fEHZ RyZ/KfmzqgEuvaN7iZa1APrdLQ4Dtnez+3tkN4fTFy7vJLZ57U8BcB6FWUw42u6R5A1J c5Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799365; x=1698404165; 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=YRbaZ8Ef1/VZbZ1Yxpg4ZanC3ZxTD3DH0ZyYq9tLTZ8=; b=gFKMfU5vaxCphNBS4u1nmqpEUy6Lxn9tmQK+iZkot3EieSyC2nV+KvqLZNnKdmBYWm Kvl5yWewjxZaGtMzzutAkdMWRUzRo5cFM+hZxO8AGsZJi/VbP9RMUIBdM25WHjkz7Vhu gMwDtc89U6wGrozlH/tufNCYlgskA3qZ5c5yBH/7uo432RDxYQuuAcKR83BkedbIaq2d AKg8W7QL2LVngM9xCVBGUFOk+MmiI1vRjmt4oSSQytudjyc0jPFEe9bqCCd31pWyfLKC dnkxcAeW3apKkS0vf/6pFasrCCcYSSW68oO56KM/95sg4qMA3Ls+LMuDaO34aBGR2DUO jOPw== X-Gm-Message-State: AOJu0Yx9uHqJCSITywEwqWFurSCkm1oHUr+sfJydqYX60eEGXopU4ubE 4WQiY3iAhIrLaZz4BKwGrvdeXA== X-Google-Smtp-Source: AGHT+IGi42aP8GCCjDqzsue+hg2+yJsIZ408/fc2DoT6sKJ1mgr20X2NyOHAsqYtdbIqRaMHmOqLvA== X-Received: by 2002:a05:600c:1912:b0:401:b6f6:d90c with SMTP id j18-20020a05600c191200b00401b6f6d90cmr1253075wmq.35.1697799365203; Fri, 20 Oct 2023 03:56:05 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:56:04 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Neil Armstrong , Rob Herring , Heiko Stuebner , Srinivas Kandagatla Subject: [PATCH 3/6] dt-bindings: nvmem: move deprecated cells binding to its own file Date: Fri, 20 Oct 2023 11:55:42 +0100 Message-Id: <20231020105545.216052-4-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafa=C5=82 Mi=C5=82ecki Support for old NVMEM fixed cells was deprecated in favour of "fixed-layout". It's still part of the nvmem.yaml though and may be unknowingly used by new bindings added without much of analyze. To make it more difficult to accidentally support old syntax move its binding to separated file with "deprecated" in its name. Signed-off-by: Rafa=C5=82 Mi=C5=82ecki Acked-by: Neil Armstrong Reviewed-by: Rob Herring Acked-by: Heiko Stuebner Signed-off-by: Srinivas Kandagatla --- .../devicetree/bindings/mtd/mtd.yaml | 7 ++++- .../bindings/mtd/partitions/nvmem-cells.yaml | 1 + .../nvmem/amlogic,meson-gxbb-efuse.yaml | 1 + .../bindings/nvmem/amlogic,meson6-efuse.yaml | 1 + .../bindings/nvmem/apple,efuses.yaml | 1 + .../devicetree/bindings/nvmem/imx-ocotp.yaml | 1 + .../bindings/nvmem/mediatek,efuse.yaml | 1 + .../nvmem/microchip,sama7g5-otpc.yaml | 1 + .../devicetree/bindings/nvmem/mxs-ocotp.yaml | 1 + .../nvmem/nvmem-deprecated-cells.yaml | 28 +++++++++++++++++++ .../devicetree/bindings/nvmem/nvmem.yaml | 9 ------ .../bindings/nvmem/qcom,qfprom.yaml | 1 + .../bindings/nvmem/qcom,sec-qfprom.yaml | 1 + .../bindings/nvmem/qcom,spmi-sdam.yaml | 1 + .../bindings/nvmem/rockchip,otp.yaml | 1 + .../bindings/nvmem/rockchip-efuse.yaml | 1 + .../nvmem/socionext,uniphier-efuse.yaml | 1 + .../bindings/nvmem/sunplus,sp7021-ocotp.yaml | 1 + .../bindings/rtc/amlogic,meson6-rtc.yaml | 1 + 19 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 Documentation/devicetree/bindings/nvmem/nvmem-deprecate= d-cells.yaml diff --git a/Documentation/devicetree/bindings/mtd/mtd.yaml b/Documentation= /devicetree/bindings/mtd/mtd.yaml index b82ca03e969c..f322290ee516 100644 --- a/Documentation/devicetree/bindings/mtd/mtd.yaml +++ b/Documentation/devicetree/bindings/mtd/mtd.yaml @@ -43,7 +43,12 @@ patternProperties: deprecated: true =20 "^otp(-[0-9]+)?$": - $ref: ../nvmem/nvmem.yaml# + type: object + + allOf: + - $ref: ../nvmem/nvmem.yaml# + - $ref: ../nvmem/nvmem-deprecated-cells.yaml# + unevaluatedProperties: false =20 description: | diff --git a/Documentation/devicetree/bindings/mtd/partitions/nvmem-cells.y= aml b/Documentation/devicetree/bindings/mtd/partitions/nvmem-cells.yaml index 5474d63268dc..9518281007af 100644 --- a/Documentation/devicetree/bindings/mtd/partitions/nvmem-cells.yaml +++ b/Documentation/devicetree/bindings/mtd/partitions/nvmem-cells.yaml @@ -19,6 +19,7 @@ maintainers: allOf: - $ref: /schemas/mtd/partitions/partition.yaml# - $ref: /schemas/nvmem/nvmem.yaml# + - $ref: /schemas/nvmem/nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/nvmem/amlogic,meson-gxbb-efu= se.yaml b/Documentation/devicetree/bindings/nvmem/amlogic,meson-gxbb-efuse.= yaml index e49c2754ff55..9801fe6f91b5 100644 --- a/Documentation/devicetree/bindings/nvmem/amlogic,meson-gxbb-efuse.yaml +++ b/Documentation/devicetree/bindings/nvmem/amlogic,meson-gxbb-efuse.yaml @@ -11,6 +11,7 @@ maintainers: =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/nvmem/amlogic,meson6-efuse.y= aml b/Documentation/devicetree/bindings/nvmem/amlogic,meson6-efuse.yaml index 84b3dfd21e09..b5cf740f96fa 100644 --- a/Documentation/devicetree/bindings/nvmem/amlogic,meson6-efuse.yaml +++ b/Documentation/devicetree/bindings/nvmem/amlogic,meson6-efuse.yaml @@ -12,6 +12,7 @@ maintainers: =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/nvmem/apple,efuses.yaml b/Do= cumentation/devicetree/bindings/nvmem/apple,efuses.yaml index e0860b6b85f3..d3abdafdbca0 100644 --- a/Documentation/devicetree/bindings/nvmem/apple,efuses.yaml +++ b/Documentation/devicetree/bindings/nvmem/apple,efuses.yaml @@ -16,6 +16,7 @@ maintainers: =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/nvmem/imx-ocotp.yaml b/Docum= entation/devicetree/bindings/nvmem/imx-ocotp.yaml index 99e60d713dac..be1314454bec 100644 --- a/Documentation/devicetree/bindings/nvmem/imx-ocotp.yaml +++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp.yaml @@ -16,6 +16,7 @@ description: | =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml b/= Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml index 7ec2988b597e..cf5f9e22bb7e 100644 --- a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml +++ b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml @@ -16,6 +16,7 @@ maintainers: =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: $nodename: diff --git a/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc= .yaml b/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml index a296d348adb4..cc25f2927682 100644 --- a/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml +++ b/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml @@ -16,6 +16,7 @@ description: | =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/nvmem/mxs-ocotp.yaml b/Docum= entation/devicetree/bindings/nvmem/mxs-ocotp.yaml index a9b822aeaa7e..f43186f98607 100644 --- a/Documentation/devicetree/bindings/nvmem/mxs-ocotp.yaml +++ b/Documentation/devicetree/bindings/nvmem/mxs-ocotp.yaml @@ -11,6 +11,7 @@ maintainers: =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/nvmem/nvmem-deprecated-cells= .yaml b/Documentation/devicetree/bindings/nvmem/nvmem-deprecated-cells.yaml new file mode 100644 index 000000000000..951af28bbfb3 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/nvmem-deprecated-cells.yaml @@ -0,0 +1,28 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/nvmem-deprecated-cells.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVMEM old syntax for fixed cells + +maintainers: + - Srinivas Kandagatla + +description: | + Before introducing NVMEM layouts all NVMEM (fixed) cells were defined + as direct device subnodes. That syntax was replaced by "fixed-layout" + and is deprecated now. No new bindings should use it. + +patternProperties: + "@[0-9a-f]+(,[0-7])?$": + type: object + allOf: + - $ref: layouts/fixed-cell.yaml + - properties: + compatible: false + deprecated: true + +additionalProperties: true + +... diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documenta= tion/devicetree/bindings/nvmem/nvmem.yaml index 9f921d940142..4fd015d402ce 100644 --- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml @@ -46,15 +46,6 @@ properties: container may reference more advanced (dynamic) layout parsers. =20 -patternProperties: - "@[0-9a-f]+(,[0-7])?$": - type: object - allOf: - - $ref: layouts/fixed-cell.yaml - - properties: - compatible: false - deprecated: true - additionalProperties: true =20 examples: diff --git a/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml b/Doc= umentation/devicetree/bindings/nvmem/qcom,qfprom.yaml index 8740938c32eb..8c8f05d9eaf1 100644 --- a/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml +++ b/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml @@ -11,6 +11,7 @@ maintainers: =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/nvmem/qcom,sec-qfprom.yaml b= /Documentation/devicetree/bindings/nvmem/qcom,sec-qfprom.yaml index 9b133f783d29..2ada2099946d 100644 --- a/Documentation/devicetree/bindings/nvmem/qcom,sec-qfprom.yaml +++ b/Documentation/devicetree/bindings/nvmem/qcom,sec-qfprom.yaml @@ -16,6 +16,7 @@ description: =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/nvmem/qcom,spmi-sdam.yaml b/= Documentation/devicetree/bindings/nvmem/qcom,spmi-sdam.yaml index cd980def97b8..068bedf5dbc9 100644 --- a/Documentation/devicetree/bindings/nvmem/qcom,spmi-sdam.yaml +++ b/Documentation/devicetree/bindings/nvmem/qcom,spmi-sdam.yaml @@ -16,6 +16,7 @@ description: | =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml b/Do= cumentation/devicetree/bindings/nvmem/rockchip,otp.yaml index 9c6eff788928..a44d44b32809 100644 --- a/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml +++ b/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml @@ -49,6 +49,7 @@ required: =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 - if: properties: diff --git a/Documentation/devicetree/bindings/nvmem/rockchip-efuse.yaml b/= Documentation/devicetree/bindings/nvmem/rockchip-efuse.yaml index c5403e149080..b80fd8d1ae5b 100644 --- a/Documentation/devicetree/bindings/nvmem/rockchip-efuse.yaml +++ b/Documentation/devicetree/bindings/nvmem/rockchip-efuse.yaml @@ -11,6 +11,7 @@ maintainers: =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/nvmem/socionext,uniphier-efu= se.yaml b/Documentation/devicetree/bindings/nvmem/socionext,uniphier-efuse.= yaml index efccc5aacbe0..e27cbae2d63a 100644 --- a/Documentation/devicetree/bindings/nvmem/socionext,uniphier-efuse.yaml +++ b/Documentation/devicetree/bindings/nvmem/socionext,uniphier-efuse.yaml @@ -12,6 +12,7 @@ maintainers: =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/nvmem/sunplus,sp7021-ocotp.y= aml b/Documentation/devicetree/bindings/nvmem/sunplus,sp7021-ocotp.yaml index da3f1de7d281..af97eeb8316c 100644 --- a/Documentation/devicetree/bindings/nvmem/sunplus,sp7021-ocotp.yaml +++ b/Documentation/devicetree/bindings/nvmem/sunplus,sp7021-ocotp.yaml @@ -12,6 +12,7 @@ maintainers: =20 allOf: - $ref: nvmem.yaml# + - $ref: nvmem-deprecated-cells.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/rtc/amlogic,meson6-rtc.yaml = b/Documentation/devicetree/bindings/rtc/amlogic,meson6-rtc.yaml index 8bf7d3a9be98..3a4551253e3e 100644 --- a/Documentation/devicetree/bindings/rtc/amlogic,meson6-rtc.yaml +++ b/Documentation/devicetree/bindings/rtc/amlogic,meson6-rtc.yaml @@ -13,6 +13,7 @@ maintainers: allOf: - $ref: rtc.yaml# - $ref: /schemas/nvmem/nvmem.yaml# + - $ref: /schemas/nvmem/nvmem-deprecated-cells.yaml# =20 properties: compatible: --=20 2.25.1 From nobody Wed Dec 17 09:46:00 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90A06C004C0 for ; Fri, 20 Oct 2023 10:56:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377102AbjJTK4T (ORCPT ); Fri, 20 Oct 2023 06:56:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377029AbjJTK4K (ORCPT ); Fri, 20 Oct 2023 06:56:10 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86DAD1BF for ; Fri, 20 Oct 2023 03:56:07 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4083cd39188so5266025e9.2 for ; Fri, 20 Oct 2023 03:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799366; x=1698404166; 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=s017N3BrJjBNK8mTEZrl4VDzs9lvd3L6fzapY0bnHq4=; b=bIvkIReWwYkdI6ePjDZg8qsHH+Cn7c2Boi90vg585ZNT5b6c1u2VMAA7k1lfGHEkrw mMrcmN5HG6fqx4WnOF7bB/9ekGSRVB6jcPvPGnty9L7eONq6XUos6+SrmDHLyJvMrOXr F2tY8L/1TfnBTp29aBzxIAYVdBSvwPDUDcT1TR0onXmHMBXZeFBjVZdKpudjIk5iJOBU FMhqvsaYxLw78ZQt13GsQdI7O4VQKZPfBuJ3bZ8wj0eeJ5pP8/EUEPjeAp24Fsizu8of Xqh62zi2W2F0eR6okQTxbOipQStrul/jexQHXx1O1o5xuCxc7ANyY2QeO5dD6vAxtYNy eBrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799366; x=1698404166; 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=s017N3BrJjBNK8mTEZrl4VDzs9lvd3L6fzapY0bnHq4=; b=orUbGfjMf3ovCr2B8/S5zDRFLRPph2DXVOd+NTpP7wzJV8tKHbYJRmYKC2Rzsp7HBq oLcv9NykBYNO6jxwhMeOKpvnW38NbM9+vvyQir8Cs4sicpETBAvBJtGUMJ+ql6nfw3mW 9FcyrSAGZj+AWFzhjUCB12kHFmPKqk+jzDV+2Zi2VdpWiv9OU9Cpfk8w9JJBkIK+EI+l yMOliemu3JhGaiySZgjSYTvkJuEccjeZutj/94BmuoiMRqER1ZHUzWS8CKwvBxx9zYMI G++Y7i6vciZ5Z3Vgn2epDZKRfYi/8TSh7xRM2KGYMUHWolA3kmL1qbztJwzYitOUqhPb vYZw== X-Gm-Message-State: AOJu0YzjlNiuf1zqIw7QZk6ns2GuOKInlw7yxfo6A9cNJApmmf3ilbMA GKeo1Ot2qhgRw6WzlqarOvQS4c1SFVhjAm3EmQ4= X-Google-Smtp-Source: AGHT+IE1Wooh/5tCSbf8CjhkPVDYNbDy9NbDsdkFap9IEltOXISDTtgc0mFAYumaaBF94N63rvuYiQ== X-Received: by 2002:a05:600c:4ece:b0:408:3ab3:a05e with SMTP id g14-20020a05600c4ece00b004083ab3a05emr1195244wmq.38.1697799366002; Fri, 20 Oct 2023 03:56:06 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:56:05 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Miquel Raynal , Srinivas Kandagatla Subject: [PATCH 4/6] Revert "nvmem: add new config option" Date: Fri, 20 Oct 2023 11:55:43 +0100 Message-Id: <20231020105545.216052-5-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafa=C5=82 Mi=C5=82ecki This reverts commit 517f14d9cf3533d5ab4fded195ab6f80a92e378f. It seems that "no_of_node" config option was added to help mtd's case. DT nodes of MTD partitions (that are also NVMEM devices) may contain subnodes that SHOULD NOT be treated as NVMEM fixed cells. To prevent NVMEM core code from parsing them "no_of_node" was set to true and that made for_each_child_of_node() in NVMEM a no-op. With the introduction of "add_legacy_fixed_of_cells" config option things got more explicit. MTD subsystem simply tells NVMEM when to look for fixed cells and there is no need to hack "of_node" pointer anymore. Signed-off-by: Rafa=C5=82 Mi=C5=82ecki Reviewed-by: Miquel Raynal Signed-off-by: Srinivas Kandagatla --- drivers/mtd/mtdcore.c | 1 - drivers/nvmem/core.c | 2 +- include/linux/nvmem-provider.h | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index fbf60d1364f0..74dd1b74008d 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -560,7 +560,6 @@ static int mtd_nvmem_add(struct mtd_info *mtd) config.read_only =3D true; config.root_only =3D true; config.ignore_wp =3D true; - config.no_of_node =3D !of_device_is_compatible(node, "nvmem-cells"); config.priv =3D mtd; =20 mtd->nvmem =3D nvmem_register(&config); diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 2710943f53c4..bf42b7e826db 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -935,7 +935,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_= config *config) nvmem->nkeepout =3D config->nkeepout; if (config->of_node) nvmem->dev.of_node =3D config->of_node; - else if (!config->no_of_node) + else nvmem->dev.of_node =3D config->dev->of_node; =20 switch (config->id) { diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 1b81adebdb8b..e3930835235b 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -89,7 +89,6 @@ struct nvmem_cell_info { * @read_only: Device is read-only. * @root_only: Device is accessibly to root only. * @of_node: If given, this will be used instead of the parent's of_node. - * @no_of_node: Device should not use the parent's of_node even if it's !N= ULL. * @reg_read: Callback to read data. * @reg_write: Callback to write data. * @size: Device size. @@ -122,7 +121,6 @@ struct nvmem_config { bool ignore_wp; struct nvmem_layout *layout; struct device_node *of_node; - bool no_of_node; nvmem_reg_read_t reg_read; nvmem_reg_write_t reg_write; int size; --=20 2.25.1 From nobody Wed Dec 17 09:46:00 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7929CDB47E for ; Fri, 20 Oct 2023 10:56:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377139AbjJTK4b (ORCPT ); Fri, 20 Oct 2023 06:56:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376974AbjJTK4K (ORCPT ); Fri, 20 Oct 2023 06:56:10 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C88E1112 for ; Fri, 20 Oct 2023 03:56:08 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4083cd39188so5266205e9.2 for ; Fri, 20 Oct 2023 03:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799367; x=1698404167; 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=J+w3Ntloijo4n7opnoBdeJ1Rm6+n13HvynO+TOERBL8=; b=psbRLtrdbQGv4g3qwXgbYRnpPKpOcM0Lv2sQWrZP90ApKAsJ5SIS65RkAlHGQyAKOn SAtogQjnrMiw9zyKlI2HRi4lc2Jfp8In4atE7lTO3f1/ZHXuuX/8olOXg68LAG4BTuGJ sfJJnCY9rkZGglg3s/1ZhgYH7kWbP9RwQyebYKlZ3fllH7WG1lNIEVWDqriC5/LtXs/V Z+320oY9r+uu/OtrVvNr4fAcsyAsd+Ic9rfi4U/dzzIh12DOBim8OUEmzz6r62nxSGxU /W1Ma4qA3TThBdzyWGKwGDysbkvXJ2uS0SWQhYVWIpiDeYrWGR0Vd9+Sr+mLt2qyFT4i jCkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799367; x=1698404167; 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=J+w3Ntloijo4n7opnoBdeJ1Rm6+n13HvynO+TOERBL8=; b=TiCPaud/8AcQg1b890kcYFOn16aKPCtkHCKfNxJktFjuzR8UaeL1RJ5l7L3YKMcYNz ryRHjOlrc+sqc7zPcqK+szhJ/tRLGxYWLUZrUFSgOHXTBnnbeKUaSq3Bdawg6R004Ps2 0uhcSHn+UuS9zW80wEe5OiGa1kM2O8ExtJWsoZ2oHOp8eHvmE9NemB5rozarjfL+MfrP 0fU1cU7HmZDKOdLXykRaK7kU1LUsTKV/tJxV/SR72Ul/P2mltA2JKdUfoHbRupX3ODkE /fwjWIDPCo9HGyvKujHtJiaYghkxSfpP/bQeNbX+wL+n9jnc7/z+/OLrnFGYmyI7LVgw 0g0g== X-Gm-Message-State: AOJu0YzicLJT7zj8qDD4+qbsieaY0odNWXwioF7dLh8GvAILJ6f1E17K CYonASKVz1YF6zqlvWWdP8Plmw== X-Google-Smtp-Source: AGHT+IEYaVw2/JGRLXTljG23GZOA5kUUjmqrm3VKbf/S4objvOuJ1Ge0P6Z+RsGggK9mJdNG5bGhPw== X-Received: by 2002:a05:600c:1992:b0:406:872d:7725 with SMTP id t18-20020a05600c199200b00406872d7725mr1225544wmq.1.1697799367265; Fri, 20 Oct 2023 03:56:07 -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.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:56:06 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Rob Herring , Conor Dooley , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Srinivas Kandagatla Subject: [PATCH 5/6] dt-bindings: nvmem: u-boot,env: Add missing additionalProperties on child node schemas Date: Fri, 20 Oct 2023 11:55:44 +0100 Message-Id: <20231020105545.216052-6-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Herring Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Signed-off-by: Rob Herring Acked-by: Conor Dooley Acked-by: Rafa=C5=82 Mi=C5=82ecki Signed-off-by: Srinivas Kandagatla --- Documentation/devicetree/bindings/nvmem/u-boot,env.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml b/Docu= mentation/devicetree/bindings/nvmem/u-boot,env.yaml index 36d97fb87865..9c36afc7084b 100644 --- a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml +++ b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml @@ -51,6 +51,8 @@ properties: ethaddr: type: object description: Ethernet interfaces base MAC address. + additionalProperties: false + properties: "#nvmem-cell-cells": description: The first argument is a MAC address offset. --=20 2.25.1 From nobody Wed Dec 17 09:46:00 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB3CECDB47E for ; Fri, 20 Oct 2023 10:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377140AbjJTK4f (ORCPT ); Fri, 20 Oct 2023 06:56:35 -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-Google-Smtp-Source: AGHT+IEhmSf4ky0G4VM0uFuoHHlAPr3EDeavNqoIYbfRHWHHQheL0Iu9+3lsngJmW9SLg23PpQgpQQ== 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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 =20 @@ -140,11 +141,10 @@ static int mxs_ocotp_probe(struct platform_device *pd= ev) struct device *dev =3D &pdev->dev; const struct mxs_data *data; struct mxs_ocotp *otp; - const struct of_device_id *match; int ret; =20 - match =3D of_match_device(dev->driver->of_match_table, dev); - if (!match || !match->data) + data =3D device_get_match_data(dev); + if (!data) return -EINVAL; =20 otp =3D devm_kzalloc(dev, sizeof(*otp), GFP_KERNEL); @@ -169,8 +169,6 @@ static int mxs_ocotp_probe(struct platform_device *pdev) if (ret) return ret; =20 - data =3D match->data; - ocotp_config.size =3D data->size; ocotp_config.priv =3D otp; ocotp_config.dev =3D 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 =20 #include "stm32-bsec-optee-ta.h" @@ -211,8 +213,7 @@ static int stm32_romem_probe(struct platform_device *pd= ev) =20 priv->lower =3D 0; =20 - cfg =3D (const struct stm32_romem_cfg *) - of_match_device(dev->driver->of_match_table, dev)->data; + cfg =3D device_get_match_data(dev); if (!cfg) { priv->cfg.read_only =3D true; priv->cfg.size =3D resource_size(res); --=20 2.25.1