From patchwork Tue Jul 18 08:48:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1809664 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=cDDksY9U; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=Qc3k6kky; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=AeVsisMe; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R5R3X0xgMz20Cs for ; Wed, 19 Jul 2023 16:38:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=tSCmYFfjB7bg6Z3K/eJdIDEHKYHuD4mbwnUXyR/MWV8=; b=cDDksY9UvLNDyg Bhh5Wv8n+W+a6sNHxTUXSxuFueD0DjEAgqV0HMviuvqwFEjH9tu+D1dOXHFQaXuVyLU9tRpn3CmvQ DAzcvzfhP65xX6Fta1Q9UO9OHHVw3DO+6SNUYFg3sMD8rivXrEkUWXnJLzV1LxhS3X1yGmKCGNdjH eo22/ucndwNIutp7krz5e/sgQxQS3Qvaii42DP8xrF7CF/g3ylGT64Mh8od+iYHDPjl2GmLVSU8kF g9PobT7UiarYAJCNbTcWxoEqoMz2mR4NZ4Lll32AGYXvcsrE1G6QnZ9F6iXPL683JxPK4UB8BJRxc I06TGpRITBSxq5lUGZkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qM0p3-005owB-0D; Wed, 19 Jul 2023 06:38:05 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qM0p0-005ouN-10 for linux-mtd@bombadil.infradead.org; Wed, 19 Jul 2023 06:38:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=IKQrnAAXrxm+V/7/n+4Qloa2USS24OYRqHFta7qvgAQ=; b=Qc3k6kkya2z08JNLxVEYAdX+IL yLO2gn7sTPMFare3GfKN3c6WtmetObZzmtgH8J8DvbKh+QF5ebnIgXJrTkFwg8b0sQGREqymJl1Fe 4PN+7aHRT8Ejqr1N2n2px+BhyPKLEHh6GatsrT49jJDDEwHbJEGaKrcp9vz1tiZISdiwbyu3u+Ido 7PTers1dmZqNSpQLmKYUBnhILWzZmMZrIlgi9x44sdvPyTlYPqgWF86YPZoV+vvMMmR//B8xhfuaz oQ1nReI5mkYUdrINLMZeRkGWi6ouqcFcAckqWTcz1JgqA4xj8fcvUZEIVB/7eaT0y3vvpgzrGZ8kE g/SfXePA==; Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qLgOT-00BJpu-1t for linux-mtd@lists.infradead.org; Tue, 18 Jul 2023 08:49:19 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fb960b7c9dso8866286e87.0 for ; Tue, 18 Jul 2023 01:49:17 -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=hcZcx4GcYisu6NbhEE0X9JSLwP5z7WQFXtvuo05GzjNzN/EbtdmDO3KNUBR/YL2BUo gBkc596afn0qTE5+YGMIxVyPta77ir/iW035/kD/V5tPgrQM+L+JnlAK79dGgp16D//N JCcrKcJsJwtMegC/DitUOnOr76NJRSqqkyrgbfQ1OOXBtqOnxNKthRYCekTbRLQ/X49n l6YP9KBtIy1ozxdwcp5p1MOzTkEsvVAzW/2X4rP+/JkS/CWtiWEb2aqzBE3xeKjKPkvq P5PmG2jGb+3cVFAIXXYaixSgN10+MOV4XsVopxVaVZkFrfKCDhiXTva0ZK1EUOyC9nJ3 y3aQ== X-Gm-Message-State: ABy/qLYTD+vLxEEqiY5ND10f4dHebML9t6hLMi0anFkqcCcR559kHMJX ngvaO5Tz1OOc0D6xrjvFfxc= 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?b?UmFmYcWCIE1pxYJlY2tp?= 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?b?UmFmYcWCIE1pxYJlY2tp?= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230718_094917_848749_B33B77B5 X-CRM114-Status: GOOD ( 16.08 ) X-Spam-Score: 0.1 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22desiato=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Rafa=C5=82_Mi=C5=82ecki_This_r?= =?unknown-8bit?q?everts_commit_517f14d9cf3533d5ab4fded195ab6f80a92e378f=2E?= =?unknown-8bit?q?_It_seems_that_=22no=5Fof=5Fnode=22_config_option_was_added?= =?unknown-8bit?q?_to_help_mtd=27s_case=2E_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E1_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freem?= =?unknown-8bit?q?ail_username_ends?= =?unknown-8bit?q?_in_digit?= =?unknown-8bit?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C?= =?unknown-8bit?q?_no_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDoxMmQgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail?= =?unknown-8bit?q?_provider?= =?unknown-8bit?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_author=27s_domain?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily?= =?unknown-8bit?q?_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Rafał Miłecki 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ł Miłecki --- Important: this is based on top of the [PATCH V4] nvmem: add explicit config option to read old syntax fixed OF cells --- 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 = true; config.root_only = true; config.ignore_wp = true; - config.no_of_node = !of_device_is_compatible(node, "nvmem-cells"); config.priv = mtd; mtd->nvmem = 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 nvmem_config *config) nvmem->nkeepout = config->nkeepout; if (config->of_node) nvmem->dev.of_node = config->of_node; - else if (!config->no_of_node) + else nvmem->dev.of_node = config->dev->of_node; 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 !NULL. * @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;