From nobody Sat Feb 7 23:23:11 2026 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 1D12CEB64DA for ; Tue, 18 Jul 2023 08:48:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232036AbjGRIsQ (ORCPT ); Tue, 18 Jul 2023 04:48:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230397AbjGRIsO (ORCPT ); Tue, 18 Jul 2023 04:48:14 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EBDBF7 for ; Tue, 18 Jul 2023 01:48:12 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fdb3f66fd6so4598251e87.3 for ; Tue, 18 Jul 2023 01:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689670090; x=1692262090; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IKQrnAAXrxm+V/7/n+4Qloa2USS24OYRqHFta7qvgAQ=; b=AeVsisMeDdKDMuBy4M5Ao2mQiTv19RMdqCBe8cETcF3jf7dsgpNOWeHswgA5cAJXuA n0lCzW9TLN7VFYDPpK0/ghORSyAZpNKOMAaPri84J9v6cpns3G0n+W2MToiOZc7lQR+G AqlqA8fx3uZJShWIFkzAYUhM7qISpYN2mfqjgpBm6NyxUKfai5rpGcip/aX7BAUm6bdf 1Y1HeLl6CJyRJvoOBLI5RdZ6zgv3TuOFyZghIMH4atj3W7ZgH63MnoByoApnTrFSqcJT zhe/DXazrYsDJxRSr19dFQFpwRW0ANPsRulC3HIjfYjdTaW0tnK5dPfJ1wC4Wn3kVYyD 0prA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689670090; x=1692262090; 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=IKQrnAAXrxm+V/7/n+4Qloa2USS24OYRqHFta7qvgAQ=; b=A3RvBTJ02ePsAuOXlWfhIedNQMK1+riDozNEiz+z9twUSzykLHA7fcMQGh9rJ7yDs7 5II56I4oH+LfKm9jT3wJxXhLYBXrsphuY3+fESA5nGPpt/6nybt4jYtEiS05/n/+6UGT ge/AAnubMBT1Al1EiNR/rjAvNRLCovaZt341yUK6h96dXE51DVAS3acgAhqUYKky32Ld 9Fo3j6hD42K9GRRdBJP/k6XLqPmoUCMVA21Lw8U/191TR26JJVavXrj/ZoXB2n0SrMxH tTh11VBs1H8eCzODVcJa7//fJukTc0pJo4JvpFz0NBC3r8Qa+o2BDOI+7DWs9usTbsje RXNw== X-Gm-Message-State: ABy/qLb/3xP3ZRlIHcTrV/K+dIskLLsHEg2q2Q2kRd3/TYG4zYWx8Y+f IoWOL0hs5DisUMnyw2sg5WY= X-Google-Smtp-Source: APBJJlGLMz1ucd/cArxQa8D7T8E7JyE0jbBpbHOfVBFkSY3iVue31sdUVun4qUGBLZL/AtmlKuRdCg== X-Received: by 2002:a05:6512:3b0a:b0:4fb:9595:15e9 with SMTP id f10-20020a0565123b0a00b004fb959515e9mr11844227lfv.22.1689670090272; Tue, 18 Jul 2023 01:48:10 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id m15-20020a056512014f00b004fb85ffc82csm340944lfo.10.2023.07.18.01.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 01:48:09 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Srinivas Kandagatla Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Bartosz Golaszewski , Alban Bedel , Christian Marangi , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH] Revert "nvmem: add new config option" Date: Tue, 18 Jul 2023 10:48:04 +0200 Message-Id: <20230718084804.20139-1-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 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 --- Important: this is based on top of the [PATCH V4] nvmem: add explicit config option to read old syntax fixed OF ce= lls --- 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 9db8d7853639..3d781ffb8c32 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -554,7 +554,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 58d8919e6682..a0c9153cda28 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -1027,7 +1027,7 @@ struct nvmem_device *nvmem_register(const struct nvme= m_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.35.3